Repository navigation
refactor(native): vendor web and desktop i18n catalogs for standalone builds - #471
Merged
Merged
Conversation
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
apps/native/crates/core/src/i18n/mod.rspreviously embedded web and desktop translation catalogs withinclude_str!("../../../../../{web,desktop}/src/i18n/translations/*.json"), breaking standaloneapps/nativecompilation whenever the parent monorepo directories are absent.Changes
en,de,es,fr,ja,ko,pt-BR,ru,sv,zh) underapps/native/crates/core/src/i18n/translations/{web,desktop}/.RAW_EN_BUNDLE,NON_DEFAULT_BUNDLES,RAW_DESKTOP_EN_BUNDLE, andNON_DEFAULT_DESKTOP_BUNDLESinapps/native/crates/core/src/i18n/mod.rsto localinclude_str!("translations/{web,desktop}/...")paths sot3-corehas zero escapinginclude_str!/include_bytes!paths.embedded_translation_catalogs_match_web_json_exactlyandembedded_desktop_catalogs_match_desktop_json_exactlyto always validate the vendored catalogs and lookup coverage, while enforcing byte-for-byte parity againstapps/{web,desktop}/src/i18n/translations/*.jsonwhenever the monorepo directories are present and succeeding cleanly in standaloneapps/nativecheckouts.shscriptapps/native/scripts/sync-i18n.sh(default copies all 20 catalogs fromapps/{web,desktop};--checkverifies byte equality viacmp -sin monorepo checkouts and presence/non-emptiness in standalone checkouts, exiting non-zero on drift).Verification
sh apps/native/scripts/sync-i18n.sh --check— pass (20 files checked), plus tested standalone--check, standalone sync error, and drift detection.CARGO_INCREMENTAL=0 cargo clippy --manifest-path apps/native/Cargo.toml --workspace --all-targets -- -D warnings— pass (0 warnings).T3_NATIVE_HOME=$(mktemp -d) CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-core --lib— 1894 passed, 0 failed.t3-corei18n::testsbuild & run in an isolated temp copy without parent monorepo dirs — 9 passed, 0 failed.include_str!/include_bytes!acrossapps/native/crates/core: 0 escaping paths. (Note:apps/native/crates/app/src/snapshot_capture/macos.rsandapps/native/crates/app/src/updates/mod.rsstill have unrelated parent-relative includes outside this PR's scope.)Generated with Antigravity (h5-standalone-i18n).