Skip to content
Vainock edited this page Aug 13, 2023 · 8 revisions

The Download Action automates the synchronization process from Crowdin to the GitHub repository by updating the authors and translations.

Features

1. Update translations in /locale/ directories

This includes the directories:

  • UI/data/locale/
  • UI/frontend-plugins/*/data/locale/
  • plugins/*/data/locale/
  • plugins/mac-virtualcam/src/obs-plugin/data/locale/

The action processes these files the following:

  • Remove empty lines: Comments in the English source files get exported as a blank line, creating an unnecessary modification.
  • Change all EOLs to \n (LF): Inconsistent EOLs in the source files on Crowdin may result differently during action execution. This normalizes this behaviour.
  • Escape line breaks in translations: A 'real' line break in a translation actually breaks the translation and makes it unused by OBS. If not corrected, an exported file may look like:
    Key="Val
    ue"
    
  • Remove translations equal to their source text: Missing translations fall back to their English variant, reducing the amount of lines and modifications.
  • Remove files with no translations.
  • Remove files from languages that have been removed on Crowdin.

2. Update AUTHORS

This file will be overwritten with a list of Git contributors and Crowdin translators sorted by most commits/most submitted words. git shortlog --all -sn --no-merges is used for the Git ranking. Banned or REMOVED_USERs + users with 0 submitted translations and approvals are excluded from the translators list.

3. Update UI/data/locale.ini

Rules:

  • If the language is present & its translation progress is less than 30%, remove it.
  • If the language is not present & its translation progress is more than 60%, add it.
  • If there is no translation for the Language string in the corresponding UI/data/locale/*.ini file, remove it.

The translation files of a removed language are kept, as long as the language exists on Crowdin.

4. Update UI/xdg-data/com.obsproject.Studio.desktop

The action merges all translation files to a single translation list and appends them to the end of the file.

5. Push Changes

The action first creates a commit in every submodule and then commits all changes (including the submodules) in the main repository. The final commit only includes submodules whose HEAD is in sync with the main repository.