-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Translation] Add new cases covered by PhpAstExtractor #17369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
javiereguiluz
merged 1 commit into
symfony:6.2
from
welcoMattic:translation/php-ast-extractor
Oct 20, 2022
Merged
[Translation] Add new cases covered by PhpAstExtractor #17369
javiereguiluz
merged 1 commit into
symfony:6.2
from
welcoMattic:translation/php-ast-extractor
Oct 20, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
fabpot
added a commit
to symfony/symfony
that referenced
this pull request
Oct 20, 2022
This PR was merged into the 6.2 branch. Discussion ---------- [Translation] Add `PhpAstExtractor` | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #44899, #42285, #45972, #45039 | License | MIT | Doc PR | symfony/symfony-docs#17369 After discussions with `@stof` and `@nicolas`-grekas at SymfonyLive Paris 2022, it appears clear that we need a brand new PhpExtractor in Translation to support various syntax, especially PHP8 new syntax (named arguments for example). In order to make this new extractor sustainable, performant and maintainable, it must be based on AST. That's why this PR adds a new optional dependency on [nikic/php-parser](https://github.com/nikic/PHP-Parser). The tests suite is the same as PhpExtractorTest, in addition to new cases for newly supported syntax. NB: I was inspired by https://github.com/php-translation/extractor design, with adaptations for Symfony. To-do: - [x] As suggested by `@Nyholm`, take a look at https://github.com/php-translation/extractor - [x] Fix #45039 (could be achieved easily with AST tree) Commits ------- 5d4a81f Add PhpAstExtractor
symfony-splitter
pushed a commit
to symfony/framework-bundle
that referenced
this pull request
Oct 20, 2022
This PR was merged into the 6.2 branch. Discussion ---------- [Translation] Add `PhpAstExtractor` | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #44899, #42285, #45972, #45039 | License | MIT | Doc PR | symfony/symfony-docs#17369 After discussions with `@stof` and `@nicolas`-grekas at SymfonyLive Paris 2022, it appears clear that we need a brand new PhpExtractor in Translation to support various syntax, especially PHP8 new syntax (named arguments for example). In order to make this new extractor sustainable, performant and maintainable, it must be based on AST. That's why this PR adds a new optional dependency on [nikic/php-parser](https://github.com/nikic/PHP-Parser). The tests suite is the same as PhpExtractorTest, in addition to new cases for newly supported syntax. NB: I was inspired by https://github.com/php-translation/extractor design, with adaptations for Symfony. To-do: - [x] As suggested by `@Nyholm`, take a look at https://github.com/php-translation/extractor - [x] Fix #45039 (could be achieved easily with AST tree) Commits ------- 5d4a81f290 Add PhpAstExtractor
Mathieu thanks for contributing this nice feature and for updating the docs too. |
symfony-splitter
pushed a commit
to symfony/framework-bundle
that referenced
this pull request
Jul 28, 2023
This PR was merged into the 6.2 branch. Discussion ---------- [Translation] Add `PhpAstExtractor` | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #44899, #42285, #45972, #45039 | License | MIT | Doc PR | symfony/symfony-docs#17369 After discussions with `@stof` and `@nicolas`-grekas at SymfonyLive Paris 2022, it appears clear that we need a brand new PhpExtractor in Translation to support various syntax, especially PHP8 new syntax (named arguments for example). In order to make this new extractor sustainable, performant and maintainable, it must be based on AST. That's why this PR adds a new optional dependency on [nikic/php-parser](https://github.com/nikic/PHP-Parser). The tests suite is the same as PhpExtractorTest, in addition to new cases for newly supported syntax. NB: I was inspired by https://github.com/php-translation/extractor design, with adaptations for Symfony. To-do: - [x] As suggested by `@Nyholm`, take a look at https://github.com/php-translation/extractor - [x] Fix #45039 (could be achieved easily with AST tree) Commits ------- 5d4a81f290 Add PhpAstExtractor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In symfony/symfony#46161, we rewrite the PHP Translation extractor. It covers more cases, like named arguments.
Documentation needed to be updated consequently.