Skip to content

Difficulty Downloading Translations for Specific Micro Frontends #926

@nik2202

Description

@nik2202

Description

I'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:
When attempting to pull only one section using the --dest option:

crowdin download translations --dest=a.json

I get the following error:

❌ Some command options are invalid. Check the following parameters:
- 'dest' must be specified with both 'source' and 'translation' parameters

Option 2: Separate Config Files Per Micro Frontend

  • packages/apps/microfrontend-a/crowdin.yml:
"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
  }
]
  • packages/apps/microfrontend-b/crowdin.yml:
"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:
This leads to conflicts because both use the same translation path (src/assets/i18n/%locale%.json), so the downloaded files overwrite each other.
This seems to be related to this issue.

Changing the translation path per micro frontend feels like a workaround, not a clean or scalable solution.


Request

Is 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions