Skip to content

Offline gym log for Android. No account, no ads, no internet.

Remove Crowdin

InlitXb733a6d0ddb8
diff --git a/.github/workflows/crowdin-locale.yml b/.github/workflows/crowdin-locale.yml
deleted file mode 100644
index 2139725..0000000
--- a/.github/workflows/crowdin-locale.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: Tidy Crowdin translations
-
-on:
- pull_request_target:
- branches: [main]
- types: [opened, synchronize, reopened]
-
-permissions:
- contents: write
-
-# Crowdin writes its own language codes into @@locale (es-ES, pt-PT, zh-CN…),
-# and gen-l10n refuses to build when @@locale doesn't match the file name.
-jobs:
- fix:
- if: github.head_ref == 'l10n_main' && github.event.pull_request.head.repo.full_name == github.repository
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- ref: l10n_main
-
- - name: Match @@locale and the repo layout
- run: |
- git fetch --depth=1 origin main
- git checkout origin/main -- lib/l10n/app_es.arb
- git show origin/main:tool/arb_tidy.py > "$RUNNER_TEMP/arb_tidy.py"
- python3 "$RUNNER_TEMP/arb_tidy.py"
- if git diff --quiet HEAD; then exit 0; fi
- git config user.name "github-actions[bot]"
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- git commit -am "Tidy the translation files"
- git push origin HEAD:l10n_main
diff --git a/crowdin.yml b/crowdin.yml
deleted file mode 100644
index 48dcbe7..0000000
--- a/crowdin.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-files:
- - source: /lib/l10n/app_en.arb
- skip_untranslated_strings: true
- translation: /lib/l10n/app_%two_letters_code%.arb
- excluded_target_languages:
- - es-ES
- languages_mapping:
- two_letters_code:
- zh-TW: zh_Hant
- locale:
- es-ES: es
- pt-BR: pt
- pt-PT: pt
- zh-CN: zh
- zh-TW: zh_Hant
diff --git a/tool/arb_tidy.py b/tool/arb_tidy.py
deleted file mode 100644
index 29076b0..0000000
--- a/tool/arb_tidy.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import glob
-import json
-import os
-import subprocess
-
-ROOT = os.path.join('lib', 'l10n')
-en = json.load(open(os.path.join(ROOT, 'app_en.arb'), encoding='utf-8'))
-order = [k for k in en if not k.startswith('@')]
-
-
-def on_main(path):
- try:
- out = subprocess.run(['git', 'show', 'origin/main:' + path.replace(os.sep, '/')], capture_output=True, check=True)
- return json.loads(out.stdout.decode('utf-8'))
- except (subprocess.CalledProcessError, ValueError):
- return {}
-
-
-for path in sorted(glob.glob(os.path.join(ROOT, 'app_*.arb'))):
- code = os.path.basename(path)[4:-4]
- if code == 'en':
- continue
- data = json.load(open(path, encoding='utf-8'))
- main = on_main(path)
- for k in list(data):
- if k.startswith('@') or data[k] != en.get(k):
- continue
- if k in main:
- data[k] = main[k]
- else:
- del data[k]
- keys = [k for k in order if k in data] + [k for k in data if not k.startswith('@') and k not in order]
- lines = [f' "@@locale": "{code}"'] + [f' {json.dumps(k)}: {json.dumps(data[k], ensure_ascii=False)}' for k in keys]
- text = '{\n' + ',\n'.join(lines) + '\n}\n'
- json.loads(text)
- with open(path, 'w', encoding='utf-8', newline='\n') as f:
- f.write(text)