Custom language mapping for GitHub integration

Is the custom languages mapping feature supposed to work with the docker github integration ? I have mapped “Chinese traditional” to “TW” and “Chinese simplified” to “CN” but it doesn’t seem to reflect it properly, the code pushed to GitHub pushes both versions to “ZH” for some reason
(I’m using 2 letter codes)

Hello @ajnart

Can you kindly provide more details about your workflow? A step-by-step sample of the Docker integration you’re using would definitely help me to better understand your case.

From the glance, I’d suggest you do mapping in %locale%

As a result, you should have this:

Chinese Simplified → %locale% → CN
Chinese Traditional → %locale% → TW

A list of our codes can be obtained here: Language Codes | Crowdin Developer Portal

Also, you’ve mentioned GitHub, so in case there’s a translation push into the same folder, perhaps there’s a need to review the translation path. This can be done from the integration UI or from the configuration file:

Here is my current setup :

This commit is Chinese Traditional :

This one is Chinese Simplified

As you can see they are both done in public/locales/zh when it should be zh and cn

Sorry @Dima, I didn’t see that I wrote docker, I meant the GitHub integration, it is not pushing commits to the correct paths.

Thank you for the details, they were really helpful.

So, this is your configuration file (found it in the public repository)

  - source: /public/locales/en/**/*.json
    translation: /public/locales/%two_letters_code%/**/%original_file_name%

This means you need to switch everything to %locale% or keep %two_letters_code%

With 1st approach, it will be enough to change the placeholder in the Translation path from %two_letters_code% into %locale%.

The system will proceed with codes like zh-TW, zh-CN, de-DE, es-ES, etc.

With 2nd approach, you need to map language codes into this pattern (because by default, without mapping both Chinese will have zh codes in two-letter pattern):

Chinese Simplified → %two-letter-codes% → CN
Chinese Traditional → %two-letter-codes% → TW

Once mapped, keep your current config without a change, and just Edit+Save the branch configuration. It will trigger the force synchronization.

Thanks a lot for this information, I’m syncing the branch now but didn’t notice the commit on my “dev” branch, it’s probably queued tho.
Just to be sure, here’s my new branch configuration setup, I believe I managed to follow all the steps you’ve indicated correctly :

It seems to be working now ! I see the commits coming-in with the correct language code

Thanks a lot for your help @Dima !

I had another question, so I’ll open a new post so that this one stays relevant on that subject.

Hi @ajnart ,

Happy to hear that it’s now working for you as you expected. We’re always happy to help!

Just remember for the future that you need to use same placeholder for language mapping and in the translation path

Yup, I’ll know now! Maybe that is some information that you’d want to add in the “language mapping” section of the settings#languages page, I wasn’t sure how to use it. Perhaps adding a link to the docs there would be helpful.

@ajnart ,

Thanks for the feedback, we have taken note your suggestion