Skip to content

[Translation] Add support for named arguments in PhpExtractor #45972

Closed
@welcoMattic

Description

@welcoMattic

Description

In PhpExtractor (used to extract translation keys (message) from PHP code), there is no support for PHP8 syntax with named arguments

ex:

$translator->trans(domain: 'validators', message: 'foo.bar')

We discussed with @stof & @nicolas-grekas about adding this support. It seems to require to add a new optional dependency on https://github.com/nikic/PHP-Parser to leverage AST features.

Todo:

  • test with a PoC with PHP-parser

Example

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions