i18n automated workflow#571
Open
burnhamrobertp wants to merge 9 commits into
Open
Conversation
Contributor
Author
|
Also, sorry for the excessive diff. I hadn't realized I'd changed the formatting on the language files Edit: nevermind that should be fixed now, I didn't notice the prettier config was violated by the regenerated localization files during my testing |
…ion files Signed-off-by: Robert Burnham <burnhamrobertp@gmail.com>
Contributor
Author
Contributor
Author
|
Before review / consideration, the need for the transifex sync parts of this PR (or could) be supplanted by https://github.com/burnhamrobertp/bar-localizations/blob/master/PROPOSAL.md |
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.
Closes #424, related to #419
Work done
Adds the automated i18n workflow infrastructure -- Transifex CLI config, GitHub Actions for bidirectional sync, CI validation, developer tooling for finding unused/missing keys, and documentation tying it all together.
Transifex CLI config
.tx/configmaps the five source files inlang/en/(lobby, interface, features, tips, units) to Transifex resources using the KEYVALUEJSON format. The org and project slugs are placeholders that need to be filled in once a Transifex project is created.GitHub Actions workflow for sync
.github/workflows/i18n-sync.ymlhas two jobs:generate-i18n-assetsto rebuild the merged locale files, and opens a PR with bothlang/andsrc/renderer/assets/languages/changes.The workflow is inert until a
TX_TOKENrepository secret is configured and the.tx/configplaceholders are replaced.CI validation
Added a step to
tests.ymlthat runs the generate script and checksgit diff --exit-codeto catch PRs that modify source translations without regenerating assets. Also runsnpm run i18n:validatewhich checks that the English reference locale is complete and reports coverage per locale.Developer tooling
Added
vue-i18n-extractas a dev dependency (this was the package suggested in the issue body) withnpm run i18n:reportto find unused translation keys in code and missing keys per locale.Deterministic asset generation
Fixed a nondeterminism issue in
generate-i18n-asset-files.tswherefs.globreturned files in arbitrary order, causing the generated assets to have different key ordering across runs. Added.sort()to the glob results so the output is stable. The CI staleness check depends on this.Documentation
Rewrote
lang/README.mdfrom a one-line placeholder into full workflow documentation covering file structure, how the automation works, developer workflow for adding strings, finding unused keys, validation, adding new locales, and manual Transifex CLI usage.What needs to happen before this goes live
<org>and<project>placeholders in.tx/configwith real slugsTX_TOKENrepository secretEverything else works without Transifex. The CI validation, staleness check, and developer tooling are all functional today.
Local testing
npm run i18n:validate-- passes (en 100%, coverage report for all locales)npm run i18n:report-- produces report of unused and missing keysnpm run generate-i18n-assets && git diff --exit-code-- passes (assets match source)AI / LLM usage statement
Developed with GitHub Copilot CLI (Claude). Used during codebase research, implementation, and testing.