Skip to content

chore(i18n): add locale contributor workflow#3297

Open
Tzeenchist wants to merge 2 commits into
BloopAI:mainfrom
Tzeenchist:feat/i18n-foundation-ru
Open

chore(i18n): add locale contributor workflow#3297
Tzeenchist wants to merge 2 commits into
BloopAI:mainfrom
Tzeenchist:feat/i18n-foundation-ru

Conversation

@Tzeenchist

@Tzeenchist Tzeenchist commented Mar 29, 2026

Copy link
Copy Markdown

Summary

  • document the locale contribution workflow in the repo
  • add a scaffold script for new locales
  • add a helper to report unchanged translation strings

Validation

  • node scripts/create-locale.mjs
  • node scripts/check-locale-translation.mjs fr
  • node scripts/check-unused-i18n-keys.mjs
  • ./scripts/check-i18n.sh

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.mjs to scaffold a new locale directory by copying English JSON namespaces, and scripts/check-locale-translation.mjs to report strings that are still identical to English (optionally failing via --fail-on-identical).

Exposes both utilities via package.json scripts (locale:new, locale:check) to standardize the workflow.

Written by Cursor Bugbot for commit 6eb3f77. This will update automatically on new commits. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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'];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

@Juanlucasbg

Copy link
Copy Markdown

Aggressive review summary — PR #3297

342-line tooling addition: locale contributor workflow. New files: docs/i18n.md (contribution guide), scripts/check-locale-translation.mjs (validator), scripts/create-locale.mjs (scaffolder), updated package.json scripts, plus docs/designs/russian-localization-upstream.md (a previous-design reference). Verdict: mixed — recommend close in sunset window unless maintainer wants archival completeness.

What it does

Builds 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 pnpm i18n:create and pnpm i18n:check scripts.

Findings

Maintainer decision points

  1. Close: Sunset window says no new contributor flows.
  2. Merge but reject downstream locale PRs: Tooling lands, but the maintainer doesn't accept new languages. Risks frustration.
  3. Merge and accept all queued locale PRs: Burns through the queue at once. Highest goodwill but greatest scope creep against the sunset stance.

NITs (assuming merge)

  • docs/designs/russian-localization-upstream.md: Reference doc for a prior design discussion. Useful archival but should be flagged as historical (date + status) so future readers don't think it's a current spec.
  • Tests: Validator scripts have no tests of their own. A small fixtures-and-assertion test would prevent regressions when the validator's logic evolves.

Verdict

Recommend 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).

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.

2 participants