Difficulty Downloading Translations for Specific Micro Frontends #927
-
DescriptionI'm working on a project that uses multiple micro frontends, and we manage translations separately for each. Ideally, we want to pull translations only for the relevant micro frontend, not the entire project. I've tried two different approaches, but both have limitations. Option 1: Single Config File in Root"files": [
{
"source": "packages/apps/microfrontend-b/src/assets/i18n/en-US.json",
"dest": "microfrontend-b/b.json",
"translation": "packages/apps/microfrontend-b/src/assets/i18n/%locale%.json",
"export_only_approved": true,
"export_translated_only": true
},
{
"source": "packages/apps/microfrontend-a/src/assets/i18n/en-US.json",
"dest": "microfrontend-a/a.json",
"translation": "packages/apps/microfrontend-a/src/assets/i18n/%locale%.json",
"export_only_approved": true,
"export_translated_only": true
}
]Issue: crowdin download translations --dest=a.jsonI get the following error: Option 2: Separate Config Files Per Micro Frontend
"files": [
{
"source": "src/assets/i18n/en-US.json",
"dest": "microfrontend-a/a.json",
"translation": "src/assets/i18n/%locale%.json",
"export_only_approved": true,
"export_translated_only": true
}
]
"files": [
{
"source": "src/assets/i18n/en-US.json",
"dest": "microfrontend-b/b.json",
"translation": "src/assets/i18n/%locale%.json",
"export_only_approved": true,
"export_translated_only": true
}
]Issue: Changing the translation path per micro frontend feels like a workaround, not a clean or scalable solution. RequestIs there a simpler, officially supported way to download translations for just one specific area or micro frontend, without restructuring the config or applying path-based workarounds? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi @nik2202! It's recommended to have a separate I just tested everything locally, and it works great with your file structure. Here is my local file tree: packages
└── apps
├── microfrontend-a
│ ├── crowdin.yml
│ └── src
│ └── assets
│ └── i18n
│ └── en-US.json
└── microfrontend-b
├── crowdin.yml
└── src
└── assets
└── i18n
└── en-US.jsonThere is a configuration file for each microfrontend: "base_path": ".."
"preserve_hierarchy": true
"files": [
{
"source": "microfrontend-a/src/assets/i18n/en-US.json",
"dest": "microfrontend-a/a.json",
"translation": "microfrontend-a/src/assets/i18n/%locale%.json",
}
]"base_path": ".."
"preserve_hierarchy": true
"files": [
{
"source": "microfrontend-b/src/assets/i18n/en-US.json",
"dest": "microfrontend-b/b.json",
"translation": "microfrontend-b/src/assets/i18n/%locale%.json",
}
]Then, from the root of the project, run the following commands specifying the crowdin push --config packages/apps/microfrontend-a/crowdin.yml
✔️ Fetching project info
✔️ Directory 'microfrontend-a'
✔️ File 'microfrontend-a/a.json'crowdin push --config packages/apps/microfrontend-b/crowdin.yml
✔️ Fetching project info
✔️ Directory 'microfrontend-b'
✔️ File 'microfrontend-b/b.json'crowdin pull --config packages/apps/microfrontend-b/crowdin.yml
✔️ Fetching project info
✔️ Building ZIP archive with the latest translations
✔️ Building translation (100%)
✔️ Downloading translations
✔️ Extracting archive
✔️ microfrontend-a/src/assets/i18n/aa-ER.json
✔️ microfrontend-a/src/assets/i18n/de-DE.json
✔️ microfrontend-a/src/assets/i18n/es-ES.json
✔️ microfrontend-a/src/assets/i18n/fr-FR.json
✔️ microfrontend-a/src/assets/i18n/ja-JP.json
✔️ microfrontend-a/src/assets/i18n/ko-KR.json
✔️ microfrontend-a/src/assets/i18n/pt-PT.json
✔️ microfrontend-a/src/assets/i18n/su-CU.json
✔️ microfrontend-a/src/assets/i18n/uk-UA.json
✔️ microfrontend-a/src/assets/i18n/zh-CN.jsoncrowdin pull --config packages/apps/microfrontend-a/crowdin.yml
✔️ Fetching project info
✔️ Building ZIP archive with the latest translations
✔️ Building translation (100%)
✔️ Downloading translations
✔️ Extracting archive
✔️ microfrontend-b/src/assets/i18n/aa-ER.json
✔️ microfrontend-b/src/assets/i18n/de-DE.json
✔️ microfrontend-b/src/assets/i18n/es-ES.json
✔️ microfrontend-b/src/assets/i18n/fr-FR.json
✔️ microfrontend-b/src/assets/i18n/ja-JP.json
✔️ microfrontend-b/src/assets/i18n/ko-KR.json
✔️ microfrontend-b/src/assets/i18n/pt-PT.json
✔️ microfrontend-b/src/assets/i18n/su-CU.json
✔️ microfrontend-b/src/assets/i18n/uk-UA.json
✔️ microfrontend-b/src/assets/i18n/zh-CN.jsonThe resulting file tree: packages
└── apps
├── microfrontend-a
│ ├── crowdin.yml
│ └── src
│ └── assets
│ └── i18n
│ ├── su-CU.json
│ ├── aa-ER.json
│ ├── ko-KR.json
│ ├── es-ES.json
│ ├── ja-JP.json
│ ├── zh-CN.json
│ ├── pt-PT.json
│ ├── uk-UA.json
│ ├── de-DE.json
│ ├── fr-FR.json
│ └── en-US.json
└── microfrontend-b
├── crowdin.yml
└── src
└── assets
└── i18n
├── su-CU.json
├── aa-ER.json
├── ko-KR.json
├── es-ES.json
├── ja-JP.json
├── zh-CN.json
├── pt-PT.json
├── uk-UA.json
├── de-DE.json
├── fr-FR.json
└── en-US.jsonP.S. Regarding the first option with |
Beta Was this translation helpful? Give feedback.
Hi @nik2202!
It's recommended to have a separate
crowdin.ymlfor each microfrontend (package in a monorepo). It is not possible to upload or download a specific group of files within a single configuration file.I just tested everything locally, and it works great with your file structure. Here is my local file tree:
There is a configuration file for each microfrontend: