mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-07-14 18:15:56 -04:00
refactor(i18n): replace compiled .ts catalogs with direct .po imports
- Remove `lingui compile` / `i18n:compile` script — Vite and Metro LingUI plugins now compile `.po` files on the fly at dev/build time; no manual compile step needed
- Import `.po` files directly in `@sofa/i18n` (`./po/en.po` etc.) and add `po.d.ts` ambient module declaration so TypeScript accepts them
- Add `fallbackLocales: { default: "en" }` and `lineNumbers: false` to `lingui.config.ts`; prefix catalog paths with `<rootDir>` for correctness
- Derive `SupportedLocale` and `SUPPORTED_LOCALES` from `LOCALE_INFO` in `locales.ts` to eliminate the circular import between `index.ts` and `locales.ts`
- Update Crowdin config to use `project_id_env` instead of a hardcoded ID, drop `languages_mapping` (no longer needed), and add `preserve_hierarchy: true`
- Add a daily cron trigger (`0 6 * * *`) to the Crowdin GitHub Actions workflow and drop the now-redundant compile step from it
- Update docs and `AGENTS.md` to reflect that no compile step is required after `i18n:extract`
This commit is contained in:
+8
-4
@@ -6,10 +6,14 @@ export default defineConfig({
|
||||
sourceLocale: "en",
|
||||
catalogs: [
|
||||
{
|
||||
path: "packages/i18n/src/po/{locale}",
|
||||
include: ["apps/web/src", "apps/native/src"],
|
||||
path: "<rootDir>/packages/i18n/src/po/{locale}",
|
||||
include: ["<rootDir>/apps/web/src", "<rootDir>/apps/native/src"],
|
||||
},
|
||||
],
|
||||
format: formatter(),
|
||||
compileNamespace: "ts",
|
||||
format: formatter({
|
||||
lineNumbers: false,
|
||||
}),
|
||||
fallbackLocales: {
|
||||
default: "en",
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user