fix: replace lobe-i18n with source-aware in-house locale pipeline - #15062
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the
@lobehub/i18n-clitranslation 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 localenow runsscripts/i18n/update-locales.ts. It records the English sources of the last successful run as git blob hashes insrc/locales/.source-manifest.json, diffs them against the currentsrc/locales/en/*.jsonto invalidate changed and deleted keys, and rebuilds every output locale from the English structure.<Picture N>,17k+5, quotedmatchandmax), retries corrupted translations, and aborts without writing if corruption persists.pnpm locale:checkreports pending work offline.collect-i18nand formatting order.@lobehub/i18n-cliand.i18nrc.cjs; configuration now lives inscripts/i18n/config.ts.openaiSDK (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.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