chore(i18n): add locale contributor workflow#3297
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| const ROOT = path.resolve(__dirname, '..'); | ||
| const LOCALES_DIR = path.join(ROOT, 'packages/web-core/src/i18n/locales'); | ||
| const SOURCE_DIR = path.join(LOCALES_DIR, 'en'); | ||
| const namespaceFiles = ['common.json', 'settings.json', 'projects.json', 'tasks.json', 'organization.json']; |
There was a problem hiding this comment.
Hardcoded namespace list diverges from dynamic discovery
Medium Severity
check-locale-translation.mjs hardcodes namespaceFiles while create-locale.mjs dynamically discovers namespace files via fs.readdirSync. If a new namespace JSON file is added to the English locale directory, the scaffold script will copy it but the translation checker will silently skip it, leaving untranslated strings undetected. Since these two scripts form a paired workflow introduced together, they need to agree on which files to process.
Additional Locations (1)
Aggressive review summary — PR #3297342-line tooling addition: locale contributor workflow. New files: What it doesBuilds a workflow for contributors to add new locales: a scaffolder generates a new locale from the source-language file, and a validator checks that every key in the source has a translation in every locale (or is left as the source-language fallback). Adds Findings
Maintainer decision points
NITs (assuming merge)
VerdictRecommend close in the sunset window. If the maintainer prefers to keep contributor tooling for forks / archival, merge — but pair with a public statement that no new locale PRs will be accepted upstream. — Reviewed by automated single-pass review (sunset-window contributor-tooling triage; full 4-tool battery skipped — the policy decision dominates the technical review). |


Summary
Validation
Note
Low Risk
Low risk: adds documentation and developer tooling scripts only; no runtime i18n behavior or CI enforcement changes.
Overview
Adds repo documentation for contributing new locales (
docs/i18n.md) and a design note describing the two-PR plan for upstreaming Russian (docs/designs/russian-localization-upstream.md).Introduces two Node scripts:
scripts/create-locale.mjsto scaffold a new locale directory by copying English JSON namespaces, andscripts/check-locale-translation.mjsto report strings that are still identical to English (optionally failing via--fail-on-identical).Exposes both utilities via
package.jsonscripts (locale:new,locale:check) to standardize the workflow.Written by Cursor Bugbot for commit 6eb3f77. This will update automatically on new commits. Configure here.