Repository navigation
Add a script to propagate English translations to all locales - #4217
Merged
Merged
Conversation
Kocal
force-pushed
the
sync-translations-script
branch
from
November 6, 2026 16:01
c6908de to
9c39ac4
Compare
Kocal
marked this pull request as ready for review
November 6, 2026 21:16
Kocal
force-pushed
the
sync-translations-script
branch
from
November 6, 2026 21:16
9c39ac4 to
667a7df
Compare
| Q | A | -------------- | --- | Bug fix? | no | New feature? | no | Deprecations? | no | Documentation? | no | Issues | | License | MIT This PR adds `.github/sync-translations.php`, adapted from the script of the same name in symfony/symfony. It copies every unit of each package's `<domain>.en.xlf` into all the other locales of that package, and a unit a locale is missing gets the English source as its target with `state="needs-translation"`. It needs `symfony/translation` and `symfony/config`, now in the root `require-dev`. The workflow is the one symfony/symfony uses: run the script after adding an English message, machine-translate the new targets, then mark them `state="needs-review-translation"` so the translation checker bot opens one issue per language for native speakers. Unlike the symfony/symfony script, this one flags only absent units, because flagging a target equal to its source would wrongly flag the French Pagination unit `Pagination`.
Kocal
force-pushed
the
sync-translations-script
branch
from
November 6, 2026 21:26
667a7df to
5d66cd0
Compare
Kocal
added a commit
that referenced
this pull request
Nov 6, 2026
| Q | A | -------------- | --- | Bug fix? | no | New feature? | no | Deprecations? | no | Documentation? | no | Issues | | License | MIT 22 Autocomplete locales were missing the `Add %placeholder%...` message. They now have a machine translation marked `state="needs-review-translation"`, as symfony/symfony does for its components. Once symfony-tools/symfony-translation-checker supports Symfony UX, it will open one issue per language asking a native speaker to review these translations. The units were added with the `.github/sync-translations.php` script from #4217. `sr_RS` uses the Latin script, like two of its three existing messages (the third is in Cyrillic). A Serbian reviewer should pick one.
Kocal
added a commit
that referenced
this pull request
Nov 6, 2026
This PR was merged into the 3.x branch. Discussion ---------- [Autocomplete] Provide missing translations | Q | A | -------------- | --- | Bug fix? | no | New feature? | no | Deprecations? | no | Documentation? | no | Issues | | License | MIT 22 Autocomplete locales were missing the `Add %placeholder%...` message. They now have a machine translation marked `state="needs-review-translation"`, as symfony/symfony does for its components. Once symfony-tools/symfony-translation-checker supports Symfony UX, it will open one issue per language asking a native speaker to review these translations. The units were added with the `.github/sync-translations.php` script from #4217. `sr_RS` uses the Latin script, like two of its three existing messages (the third is in Cyrillic). A Serbian reviewer should pick one. Commits ------- f33982e [Autocomplete] Provide missing translations
Kocal
added a commit
that referenced
this pull request
Nov 6, 2026
| Q | A | -------------- | --- | Bug fix? | no | New feature? | no | Deprecations? | no | Documentation? | no | Issues | | License | MIT The "Code Quality" job now runs `.github/sync-translations.php` (added in #4217) and fails if a catalogue under `src/*/translations/` changes. It prints the diff to apply, like the check the job already does for `.github/sync-packages.php`. A PR that adds an English message without adding it to the other locales now fails. The author runs the script, then either machine-translates the new targets with `state="needs-review-translation"` or leaves them in `needs-translation`. Both states are reported to native speakers by symfony-tools/symfony-translation-checker. This replaces extending the checker's automated sync PR to symfony/ux, which would need a carsonbot fork of symfony/ux.
Kocal
added a commit
that referenced
this pull request
Nov 6, 2026
This PR was merged into the 3.x branch. Discussion ---------- Check that translations are in sync in CI | Q | A | -------------- | --- | Bug fix? | no | New feature? | no | Deprecations? | no | Documentation? | no | Issues | | License | MIT The "Code Quality" job now runs `.github/sync-translations.php` (added in #4217) and fails if a catalogue under `src/*/translations/` changes. It prints the diff to apply, like the check the job already does for `.github/sync-packages.php`. A PR that adds an English message without adding it to the other locales now fails. The author runs the script, then either machine-translates the new targets with `state="needs-review-translation"` or leaves them in `needs-translation`. Both states are reported to native speakers by symfony-tools/symfony-translation-checker. This replaces extending the checker's automated sync PR to symfony/ux, which would need a carsonbot fork of symfony/ux. Commits ------- 44378dc Check that translations are in sync in CI
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.
This PR adds
.github/sync-translations.php, adapted from the script of the same name in symfony/symfony. It copies every unit of each package's<domain>.en.xlfinto all the other locales of that package, and a unit a locale is missing gets the English source as its target withstate="needs-translation".It needs
symfony/translationandsymfony/config, now in the rootrequire-dev. The workflow is the one symfony/symfony uses: run the script after adding an English message, machine-translate the new targets, then mark themstate="needs-review-translation"so the translation checker bot opens one issue per language for native speakers.Unlike the symfony/symfony script, this one flags only absent units, because flagging a target equal to its source would wrongly flag the French Pagination unit
Pagination.