-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add wp i18n make-php
command
#363
Conversation
@swissspidy What sort of review would you like on this? |
@danielbachhuber just a general review if the code and code style look sane. Functionality-/logic-wise I will be syncing this with any developments in core (see https://make.wordpress.org/core/2023/11/08/merging-performant-translations-into-core/ for the latest post) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Command code generally seems fine. I didn't test the actual functionality, though. I left a few nits inline.
And the foo-plugin/foo-plugin-de_DE.php file should contain: | ||
""" | ||
'messages'=>[''=>['Foo Plugin'=>['Bar Plugin']]] | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a test that verifies a valid PHP translation file is produced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid as in syntax or as in translation gets loaded properly in WordPress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking the latter but we could check both, I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably best done in a future PR because we don't have similar assertions for the other file formats, and the PHP format especially is not yet merged into core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
Follow-up to #363. Requirement for WP 6.5 support.
The WordPress core performance team is working on the Performant Translations feature project, which aims to speed up translations by using PHP files instead of MO files. The goal is to get it ready for WordPress 6.5.
While the idea is to have translate.wordpress.org ship these PHP files in language packs, some developers might be using WP-CLI for their i18n workflow, especially locally. For them it would be beneficial to be able to quickly generate the necessary translation files.
Additional Context