Skip to content

i18n automated workflow#571

Open
burnhamrobertp wants to merge 9 commits into
beyond-all-reason:masterfrom
burnhamrobertp:feature/424-i18n-automated-workflow
Open

i18n automated workflow#571
burnhamrobertp wants to merge 9 commits into
beyond-all-reason:masterfrom
burnhamrobertp:feature/424-i18n-automated-workflow

Conversation

@burnhamrobertp

Copy link
Copy Markdown
Contributor

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/config maps the five source files in lang/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.yml has two jobs:

  • push-source runs on push to master when English source files change. Pushes source strings to Transifex so translators see updates immediately.
  • pull-translations runs on a daily schedule and via manual dispatch. Pulls all translations from Transifex, runs generate-i18n-assets to rebuild the merged locale files, and opens a PR with both lang/ and src/renderer/assets/languages/ changes.

The workflow is inert until a TX_TOKEN repository secret is configured and the .tx/config placeholders are replaced.

CI validation

Added a step to tests.yml that runs the generate script and checks git diff --exit-code to catch PRs that modify source translations without regenerating assets. Also runs npm run i18n:validate which checks that the English reference locale is complete and reports coverage per locale.

Developer tooling

Added vue-i18n-extract as a dev dependency (this was the package suggested in the issue body) with npm run i18n:report to find unused translation keys in code and missing keys per locale.

Deterministic asset generation

Fixed a nondeterminism issue in generate-i18n-asset-files.ts where fs.glob returned 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.md from 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

  1. Create a Transifex project for bar-lobby
  2. Replace the <org> and <project> placeholders in .tx/config with real slugs
  3. Add a TX_TOKEN repository secret

Everything 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 keys
  • npm run generate-i18n-assets && git diff --exit-code -- passes (assets match source)
  • All existing tests pass (28/28), typecheck clean, lint clean, prettier clean

AI / LLM usage statement

Developed with GitHub Copilot CLI (Claude). Used during codebase research, implementation, and testing.

@burnhamrobertp

burnhamrobertp commented Apr 27, 2026

Copy link
Copy Markdown
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>
@burnhamrobertp

burnhamrobertp commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

See my comment here . If found to be a compelling approach, then something like a bar-translations repo would be the target for the changes in this PR instead of bar-lobby, and bar-lobby would use #419 to integrate with that other repo

@burnhamrobertp burnhamrobertp changed the title Feature/424 i18n automated workflow i18n automated workflow Apr 27, 2026
@burnhamrobertp

Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup I18n automated workflow

1 participant