Repository navigation
I18N: Use translation-revision-date header for PHP translation files - #99
Closed
swissspidy wants to merge 1 commit into
Closed
swissspidy wants to merge 1 commit into
swissspidy wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
swissspidy
force-pushed
the
claude/cool-ptolemy-qsvrwm
branch
from
November 26, 2026 14:37
6396828 to
289120a
Compare
GlotPress generates PHP translation files with a `translation-revision-date` header instead of the `po-revision-date` header used in PO and MO files. `wp_get_l10n_php_file_data()` now reads the revision date from that header, and `WP_Translation_File::transform()` renames the header accordingly when converting between MO and PHP files. See #65809. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5mDonfFaS5ooNyetmH
swissspidy
force-pushed
the
claude/cool-ptolemy-qsvrwm
branch
from
November 26, 2026 14:40
289120a to
c75063f
Compare
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
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.
GlotPress generates
.l10n.phpfiles with atranslation-revision-dateheader, notpo-revision-date(source). Because of this mismatch,wp_get_installed_translations()returned an emptyPO-Revision-Datefor PHP-only translations.This PR uses
translation-revision-datethroughout:wp_get_l10n_php_file_data()readsPO-Revision-Datefromtranslation-revision-date.WP_Translation_File_PHP::export()renamespo-revision-datetotranslation-revision-date. As a result,WP_Translation_File::transform( $mo, 'php' )now produces the same header that GlotPress does.WP_Translation_File_MO::export()does the reverse, so a PHP → MO conversion still writespo-revision-date.There is no backward-compatibility handling for the old
po-revision-datekey in PHP files. It only matters when the.mo/.pofiles are missing, which should be rare.pot-creation-dateis unchanged. GlotPress doesn't emit it, so it reads as''for GlotPress files.transform()copies headers generically, so it is carried over only when the source file has it.Tests: the
de_CH.l10n.phpfixture now uses the new key. Two new tests cover MO → PHP and PHP → MO. Themo to phpround-trip test now expects the rename, sinceexample-simple.mohas aPO-Revision-Dateheader.Trac ticket: https://core.trac.wordpress.org/ticket/65809
Use of AI Tools
This PR was written with Claude Code (code and tests), under the direction of and with review by the PR author. The full PHPUnit suite could not be run in the authoring environment, so the changed logic was checked with a standalone script against the real classes and fixtures.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UWTd5mDonfFaS5ooNyetmH