Two_letter_code & locale

Hello there, I am currently trying to make my crowdin project use both %locale% and %two_letter_code% and change the name of translations file when synced with github? Cause I want some of my files to be like %two_letter_code% and %locale% due to translation system on another platform

This is what I tried with the crowdin.yml file

'files':
    [
        {
            'source': '/packages/bot/locales/en-US/*.json',
            'translation': '/packages/bot/locales/%locale%/%original_file_name%',
            'languages_mapping':
                {
                    'locale':
                        {
                            'bg-BG': 'bg',
                            'cs-CZ': 'cs',
                            'da-DK': 'da',
                            'de-DE': 'de',
                            'el-GR': 'el',
                            'fi-FI': 'fi',
                            'fr-FR': 'fr',
                            'hi-IN': 'hi',
                            'hr-HR': 'hr',
                            'hu-HU': 'hu',
                            'id-ID': 'id',
                            'it-IT': 'it',
                            'ja-JP': 'ja',
                            'ko-KR': 'ko',
                            'lt-LT': 'lt',
                            'nl-NL': 'nl',
                            'no-NO': 'no',
                            'pl-PL': 'pl',
                            'ro-RO': 'ro',
                            'ru-RU': 'ru',
                            'th-TH': 'th',
                            'uk-UA': 'uk',
                            'vi-VI': 'vi',
                        },
                },
        },
    ]

Hi @DuckoDas , you’re welcome to set the Language mapping directly in Crowdin project, not in the Configuration file. Here is the documentation on it:

Trying that, but is it possible after saving to view the current ones instead of making new ones? On the custom language mapping section

Dear @DuckoDas , you’re welcome to view current codes that are used by default in our documentation:

Also when choosing any placeholder (locale, two letters code etc) for the language, you may see the code that the system uses by default, it’ll be greyed out but you will need to paste your desired code

@DuckoDas The languages mapping format is the following: crowdin_language_code: code_you_use. Check the full list of Crowdin language codes that can be used for mapping.

For more details see the Languages mapping configuration.

You see this is my full crowdin file with all languages and still all of the always return as locale

'files':
    [
        {
            'source': '/packages/bot/locales/en-US/*.json',
            'translation': '/packages/bot/locales/%locale%/%original_file_name%',
            'languages_mapping':
                {
                    'locale':
                        {
                            'bg-BG': 'bg',
                            'zh-CN': 'zh-CN',
                            'zh-TW': 'zh-TW',
                            'cs-CZ': 'cs',
                            'da-DK': 'da',
                            'en-GB': 'en-GB',
                            'en-US': 'en-US',
                            'de-DE': 'de',
                            'el-GR': 'el',
                            'fi-FI': 'fi',
                            'fr-FR': 'fr',
                            'hi-IN': 'hi',
                            'hr-HR': 'hr',
                            'hu-HU': 'hu',
                            'id-ID': 'id',
                            'it-IT': 'it',
                            'ja-JP': 'ja',
                            'ko-KR': 'ko',
                            'lt-LT': 'lt',
                            'nl-NL': 'nl',
                            'no-NO': 'no',
                            'pt-BR': 'pt-BR',
                            'pl-PL': 'pl',
                            'ro-RO': 'ro',
                            'ru-RU': 'ru',
                            'es-ES': 'es-ES',
                            'sv-SE': 'sv-SE',
                            'th-TH': 'th',
                            'uk-UA': 'uk',
                            'vi-VI': 'vi',
                        },
                },
        },
    ]

Hi @DuckoDas could you please kindly use these codes for the languages on the left and the desired codes after the colon?

Just checked them all and they all match the website’s codes

Dear @DuckoDas , please try to set up language mapping in Crowdin directly:

@DuckoDas please review your mapping carefully. The left part of the mapping should contain the Crowdin language codes and the right part - your codes.

crowdin code : your code

1 Like

Ah thanks, that worked, my fault sorry!