Is it possible to add langAliases for a single output rule?

Is there a way to replicate the functionality of langAliases for a single output rule?

I’m using Fastlane, which requires some languages to include region codes, e.g. “de-DE” instead of just “de”. I’m able to get around this with langAliases, but it applies to all downloaded files instead
of just the one rule I need to apply it to.

No, it’s not possible. But you can use several different ways how to achieve it:

  1. If you don’t need the region code, you can just use the variable ${languageCode} instead.

  2. You can use transformations to generate different locale codes and, e.g., remove everything after -.

  3. You can use langExpansions instead of langAliases and filter content using conditions.

1 Like

Thanks! Using transformations for this was easier than I thought.

  "transformations": [
    {
        "name": "fastlaneLang",
        "source": "${lang}",
        "operations": [
          "replace: de, de-DE",
          "replace: es, es-ES",
          "replace: fr, fr-FR"
        ]
    }
  ],
2 Likes

Awesome! I had something like substringBefore: - in my mind but this is clean and readable.

Also, I do really think that using ${languageCode} would be even faster and you wouldn’t even need the transformations at all.

I’m not sure how ${languageCode} would be useful here since what I’m trying to do is go from these languages in Localazy to these supported languages in Fastlane:

en      -> en-US
ar-SA   -> ar-SA
de      -> de-DE
es      -> es-ES
fr      -> fr-FR
ja      -> ja
ko      -> ko
ru      -> ru
sv      -> sv
tr      -> tr
zh-Hans -> zh-Hans
zh-Hant -> zh-Hant
1 Like

I see. This is a better solution then.