From a014391ae7e415256d47bec9925e93be9caf9922 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 13 Mar 2022 16:29:51 -0400 Subject: [PATCH] Update for Crowdin Integration - Rename extracted template file to `sunshine.po` - Add `crowdin.yml` - Remove `--init` and `--update` from `localize.yml` - Crowdin will initialize new languages and update existing ones --- .github/workflows/localize.yml | 2 +- crowdin.yml | 17 +++++++++++++++++ scripts/_locale.py | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 crowdin.yml diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml index 0ca9e621..eafc7430 100644 --- a/.github/workflows/localize.yml +++ b/.github/workflows/localize.yml @@ -35,7 +35,7 @@ jobs: - name: Update Strings run: | - python ./scripts/_locale.py --extract --init --update + python ./scripts/_locale.py --extract - name: GitHub Commit & Push # push changes back into nightly uses: actions-js/push@v1.2 diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 00000000..d014a00c --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,17 @@ +"base_path": "." +"base_url": "https://api.crowdin.com" # optional (for Crowdin Enterprise only) +"preserve_hierarchy": false # flatten tree on crowdin + +"files" : [ + { + "source" : "/locale/*.po", + "translation" : "/locale/%two_letters_code%/LC_MESSAGES/%original_file_name%", + "languages_mapping": { + "two_letters_code": { + # map non-two letter codes here, left side is crowdin designation, right side is babel designation + "en-GB": "en_GB", + "en-US": "en_US" + } + } + } +] diff --git a/scripts/_locale.py b/scripts/_locale.py index 4a2ec2c1..b26a0592 100644 --- a/scripts/_locale.py +++ b/scripts/_locale.py @@ -38,7 +38,7 @@ def x_extract(): commands = [ 'xgettext', f'--default-domain={project_name.lower()}', - f'--output={os.path.join(locale_dir, project_name.lower() + ".pot")}', + f'--output={os.path.join(locale_dir, project_name.lower() + ".po")}', '--language=C++', '--boost', '--from-code=utf-8',