Skip to content

Crowdin maintenance

Senén Rodero edited this page Sep 23, 2020 · 19 revisions

Steps to do a full Crowdin update:

In Crowdin:

  1. Click "Pause Sync" and then "Resume" from the Github section.
  2. Approve all translations from the proofreader view.
  3. Click "Build project" from settings.

In your local machine:

  1. Check a branch from the linked crowding branch (i18n_master) and squash all commits in another branch:
git fetch
git branch -D i18n_master
git checkout i18n_master
git branch -D i18n_crowdin
git checkout -b i18n_crowdin
git reset $(git merge-base master i18n_crowdin)
git add -A
git commit -m "Update translations from Crowdin"
git push origin -f i18n_crowdin
  1. Wait for travis build to pass.
  2. Merge the PR.
  3. Delete the i18n_master branch in Github (Crowdin will regenerate it when necessary).

Notes:

If adding a new language:

  1. Add it to the available locales in application.rb.
  2. Make sure the name of the locale is correctly translated in /config/locales/<language_id>/i18n.yml.
  3. Add a fallback rule if a language other than English is more appropriate.
  4. Ensure the new language locale code is correct and does not collides with any other application language.

How to deal with locale code collision problems between languages

Sometimes Crowdin integration send us the translations from two dialects of the same language using the same locale code within the files, this logically makes Rails to merge the translations under the same locale code then the application will not work as expected. This happened with Portuguese and Portuguese-Brazileiro, where all files within config/locales/pt and config/locales/pt-BR were send using the same locale code pt so Portuguese and Portuguese-Brazileiro translations were mixed and also were completely empty for Portuguese-Brazileiro in Rails memory. After asking for help to Crowdin support service they fixed on their side by adding an special post-processor that fixes how the integration sends to our repository Portuguese-Brazileiro translations. The same happened with Serbian (Cyrillic) and Serbian (Latin) translations. At this time, this cannot be fixed from crowdin.yml configuration file, the language_mapping option is only to change the folder name not the locale within the files.

Gotchas:

English is the base language in Crowdin, however we also write translations in Spanish directly in Github. Crowdin expects a single language to be maintained from Github and the other languages from Crowdin. This sometimes creates unaccounted behaviours in the Spanish locale (es). So please review carefully the Spanish translations and take into account these points:

  • If a translations is obsolete, go to Crowdin and approve the correct translations for that key.
  • If a translations is missing, add it manually in Crowdin, and sync again with Github clicking on "Sync Now" from the Crowdin Integrations page.