-
Notifications
You must be signed in to change notification settings - Fork 60
Write the revision date as translation-revision-date in make-php #503
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
Open
swissspidy
wants to merge
2
commits into
main
Choose a base branch
from
fix/php-array-generator-translation-revision-date
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+35
−2
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: wp-cli/i18n-command
Length of output: 50375
🏁 Script executed:
Repository: wp-cli/i18n-command
Length of output: 6377
🌐 Web query:
WordPress core current source .l10n.php translation-revision-date po-revision-date WP_Translation_Controller💡 Result:
In WordPress core, the components you referenced relate to the translation system's infrastructure for handling PHP-based translation files (
.l10n.php) and the centralized management of translation data [1][2][3]..l10n.php and Metadata The.l10n.phpfile format was introduced to provide a more performant alternative to traditional.moand.potranslation files [3]. WordPress uses the functionwp_get_l10n_php_file_data()to extract specific header metadata from these files [1][4]. The headers extracted include [1]: - POT-Creation-Date (mapped from 'pot-creation-date') - PO-Revision-Date (mapped from 'po-revision-date') - Project-Id-Version (mapped from 'project-id-version') - X-Generator (mapped from 'x-generator') These headers are standard in Gettext PO/POT files, andwp_get_l10n_php_file_dataensures that PHP translation files maintain compatibility with this metadata structure [1][2]. WP_Translation_Controller Introduced in WordPress 6.5,WP_Translation_Controllerserves as a core class for managing translation loading and retrieval [5][6]. It acts as a centralized controller to handle multiple translation files for a given text domain [5][7]. Key responsibilities of this controller include [5]: - Loading translation files (load_file) [6]. - Locating translations for strings within specific text domains and locales (locate_translation) [7]. - Managing the state of loaded files and translations [5][6]. - Providing utility methods to retrieve information about loaded files, such as headers, viaget_headers()[5]. Together, these systems represent a modernization of WordPress's internationalization (i18n) stack, shifting toward more efficient PHP-based file parsing and centralized object-oriented management [3][5].Citations:
🏁 Script executed:
Repository: wp-cli/i18n-command
Length of output: 2460
Preserve
po-revision-datefor WordPress compatibility.wp_get_l10n_php_file_data()readsPO-Revision-Datefrompo-revision-date.PhpArrayGenerator::toArray()emits onlytranslation-revision-date, so WordPress readers can lose the revision date. Emit both keys, or update the reader and end-to-end coverage in the same change. Update thefeatures/makephp.featurescenario that currently asserts the legacy key is absent.🤖 Prompt for AI Agents