crowdin-cli-v1 icon indicating copy to clipboard operation
crowdin-cli-v1 copied to clipboard

Using locale or two letter code based on project

Open amura11 opened this issue 7 years ago • 2 comments

I have a project in Crowdin that's being translated into French (fr), Spanish Mexico (es-MX), and Spanish Spain (es-ES). I'm running into an issue where if I defined my configuration to use %locale% the translations for French have fr-FR in the name (which causes C# to fallback if the locale is fr-CA for example) but if I use %two_letters_code% I only get files with es in the name. If I manually download the files they have the correct codes (fr, es-MX, and es-ES).

Is there anyway to setup my configuration so my files download using either the two letter code or the full locale based on the project?

amura11 avatar Feb 27 '18 23:02 amura11

Hi @amura11 Yes, you can use Languages mapping.

I think something like this should help you:

files:
  -
    source: [...]
    translation: [...]
    languages_mapping:
      locale:
        # crowdin_language_code: local_name
        fr: fr

mamantoha avatar Mar 02 '18 06:03 mamantoha

Thanks for the idea, I was wondering if that would work. Unfortunately that isn't ideal; every time a new language is added I have to go through each config file and make sure it's up to date. When I manually download the files from Crowdin they already have the correct locales/language codes, is there anyway to preserve that? If there isn't I might as well just go back to doing things manually.

amura11 avatar Mar 02 '18 15:03 amura11