Skip to content

fix: replace lobe-i18n with source-aware in-house locale pipeline - #15062

Merged
benceruleanlu merged 7 commits into
mainfrom
bl/in-house-i18n-pipeline-1b91ce
Aug 13, 2026
Merged

fix: replace lobe-i18n with source-aware in-house locale pipeline#15062
benceruleanlu merged 7 commits into
mainfrom
bl/in-house-i18n-pipeline-1b91ce

Conversation

@benceruleanlu

@benceruleanlu benceruleanlu commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

Replace the @lobehub/i18n-cli translation step with an in-house pipeline (scripts/i18n/) so changed English source strings are retranslated, removed keys are pruned, and protected syntax survives translation byte-for-byte.

The user-facing and correctness repairs were split into #15137 (merged). This PR is strictly the framework migration.

Changes

  • pnpm locale now runs scripts/i18n/update-locales.ts. It records the English sources of the last successful run as git blob hashes in src/locales/.source-manifest.json, diffs them against the current src/locales/en/*.json to invalidate changed and deleted keys, and rebuilds every output locale from the English structure.
  • Validates interpolation placeholders and protected literals (<Picture N>, 17k+5, quoted match and max), retries corrupted translations, and aborts without writing if corruption persists.
  • pnpm locale:check reports pending work offline.
  • Normalizes English entry files to the committed serialization before hashing so manifest hashes match workflow commits regardless of collect-i18n and formatting order.
  • Removes @lobehub/i18n-cli and .i18nrc.cjs; configuration now lives in scripts/i18n/config.ts.
  • Translation requests go through the official openai SDK (the one new dependency, dev-only with no transitive dependencies), which owns transport retries, timeouts, and typed completion parsing; the pipeline keeps only domain-level retries for truncated or malformed completions.
  • Uses a blobless full-history checkout in the i18n workflows so recorded English source blobs can be fetched on demand.

Review Focus

Manifest advancement only after full validation; rebuild-from-source semantics; translation retry and validation behavior; and source-provenance handling.

Depends on #15137 (merged). Supersedes #15024.

FE-1499

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

Labels

claude-review Add to trigger a PR code review from Claude Code risk:R3 PR risk grade (advisory shadow check; grader-owned) size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants