Skip to content

feat(i18n): add translation drift check script - #593

Open
Argulz wants to merge 4 commits into
masterfrom
i18n/drift-check
Open

Argulz wants to merge 4 commits into
masterfrom
i18n/drift-check

Conversation

@Argulz

@Argulz Argulz commented Sep 21, 2026 •

Copy link
Copy Markdown

This PR adds the translation drift checker referred to by the Translation Guidelines (sections 9 and 13), as announced in #592. As requested, everything is in a single PR.

Affected files:

  • scripts/i18n-drift-check.mjs - the checker, first written by @MaximeNzo and improved with @Nounagnon02. Each translated page records the git hash of the English page it was made from (i18n_source_sha in its front matter); a translation is reported as stale when that hash no longer matches. Modes: check of a git range (default), --audit of the whole repository with coverage per locale and section, --explain <page> to show what changed in the source, --stamp to record hashes. It only reports: nothing blocks a PR, and this PR does not modify any documentation page.
  • scripts/i18n-drift-check.test.mjs - 20 tests, run against throwaway git repositories. No new dependency: Node built-ins only.
  • scripts/i18n-drift-check.md - usage guide: commands, statuses, workflow by role, tests, troubleshooting.
  • .github/workflows/i18n-translation-drift.yml - GitHub Actions workflow: posts the report as a comment on PRs, and opens an issue when drift reaches master. It runs alongside CircleCI, independently.
  • package.json - the i18n:* npm scripts.
  • .gitignore - the generated i18n-report.* files.

How to test:

  • npm run i18n:test - 20 tests pass
  • npm run i18n:audit - prints the report; on current master it lists 2 orphaned French pages (docs/fr/product/features/CurrencyConversion/README.md and docs/fr/product/features/merchant-payments.md)

AI Assistance Disclosure
AI tools were used in producing part of this contribution.
Tools used: Claude
Scope: bug fixes, new options, the test suite, the documentation, and this PR description.
All AI-generated content has been reviewed, understood, and validated by the author.

Relates to #592

Add scripts/i18n-drift-check.mjs, the drift checker referred to by the
Translation Guidelines. Each translated page records the git hash of the
English page it was made from (i18n_source_sha); a translation is reported
as stale when that hash no longer matches.

Includes the test suite, the i18n:* npm scripts and the .gitignore entries
for the generated reports. Report only: nothing blocks a PR, and no
documentation page is modified.

Relates to #592

Co-authored-by: MaximeNzo <[email protected]>
Co-authored-by: Nounagnon02 <[email protected]>
@CLAassistant

CLAassistant commented Sep 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@mojaloopci

Copy link
Copy Markdown

Preview deployment is available at: https://docs.mojaloop.io/pr/593/

Add scripts/i18n-drift-check.md, the usage guide referenced in the script
header, and the GitHub Actions workflow that posts the drift report on pull
requests and opens an issue when drift reaches master.

Relates to #592

Co-authored-by: MaximeNzo <[email protected]>
Co-authored-by: Nounagnon02 <[email protected]>
@github-actions

Copy link
Copy Markdown

Translation Drift Report

🔧 docs/pt/ exists on disk but is not declared in docs/.vuepress/config.js. It is treated as a locale here, but VuePress will not build a language switcher for it.

No source documentation changed in this range. Nothing to translate.

@mojaloopci

Copy link
Copy Markdown

Preview deployment is available at: https://docs.mojaloop.io/pr/593/

The master job created a new issue on every push with drift. It now looks
for an open issue carrying a hidden marker, as the PR job does for its
comment, and adds the new report to it as a comment. A new issue is only
created when none is open.

Relates to #592

Co-authored-by: MaximeNzo <[email protected]>
Co-authored-by: Nounagnon02 <[email protected]>
@mojaloopci

Copy link
Copy Markdown

Preview deployment is available at: https://docs.mojaloop.io/pr/593/

@elnyry-sam-k elnyry-sam-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mojaloopci

Copy link
Copy Markdown

Preview deployment is available at: https://docs.mojaloop.io/pr/593/

This branch has not been deployed

No deployments
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.

4 participants