-
Notifications
You must be signed in to change notification settings - Fork 8
Download Action
The download action automates the update process of authors, the list of selectable languages and translations for all plugins, submodules, and other instances where translatable content is present. In addition it shrinks the size of the translated files and removes any kind of unnecessary modification to prevent these files from being updated.
This applies to:
UI/data/locale/
plugins/*/data/locale/
plugins/enc-amf/resources/locale/
plugins/mac-virtualcam/src/obs-plugin/data/locale/
The action builds the Crowdin project, downloads the newest build and extracts UI/
and plugins/
into its memory. There it processes the contents and afterwards writes them to their destination:
- Remove empty lines: Comments put into 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: Again, this reduces the amount of redundant modifications, because a translation equal to their source and a non-existing translation are indistinguishable in the UI. A missing translation falls back to the English source text.
- Remove empty (no translations) files.
- Remove files from languages that have been removed on Crowdin.
This file will be overwritten with a list of the Git contributors and Crowdin translators sorted by most commits or most submitted words in their combined translations. The used Git command is git shortlog --all -sn --no-merges
and banned or REMOVED_USER
s are excluded from the translators.
- If a language is present, remove it if the translation progress is less than 30%.
- If a language is not present, add it if it has more than 60%.
The language name will be updated for all languages and will be taken from the Language
string in a UI/data/locale/
file. If it's missing, remove the language from the list.
The translation files of a removed language are kept as long as they haven't been removed by a previous step, and therefore still usable by old users, but no longer selectable in the language list.
The translation files are exported in the desktop-entry/
build directory. They are then merged, properly formatted and after the removal of previous translations in this file appended to the end of the file.
The action first creates a commit in every submodule and then commits all changes (including the submodules) in the main repository. Submodule pushes will be skipped, if they contain other unpushed commits not already contained in the main repository.