Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Update translation workflow to include additional languages

Bill Yang8c82bd3f5d2d
diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml
index 2f08acaad..5c6c41e0d 100644
--- a/.github/workflows/translate.yml
+++ b/.github/workflows/translate.yml
@@ -38,7 +38,10 @@ jobs:
cd client/messages
EN_KEYS=$(python3 -c "import json; f=open('en.json'); d=json.load(f); print(len(d))")
NEEDS_TRANSLATION=false
- for file in zh.json ja.json de.json pl.json pt.json it.json fr.json ko.json es.json; do
+ # Must stay in sync with the `locales` array in client/next.config.ts —
+ # the extractor writes empty keys to every locale listed there, and any
+ # locale missing here is never checked and never translated.
+ for file in zh.json ja.json de.json pl.json pt.json it.json fr.json ko.json es.json cs.json uk.json; do
LANG_KEYS=$(python3 -c "import json; f=open('$file'); d=json.load(f); print(len(d))")
EMPTY=$(python3 -c "import json; f=open('$file'); d=json.load(f); print(sum(1 for v in d.values() if v == ''))")
if [ "$EMPTY" -gt 0 ] || [ "$LANG_KEYS" -ne "$EN_KEYS" ]; then
@@ -89,7 +92,7 @@ jobs:
Check the translation files in client/messages/. The source of truth is en.json.
- For each non-English translation file (zh.json, ja.json, de.json, pl.json, pt.json, it.json, fr.json, ko.json, es.json):
+ For each non-English translation file (zh.json, ja.json, de.json, pl.json, pt.json, it.json, fr.json, ko.json, es.json, cs.json, uk.json):
1. Find any keys that have empty string values (these are newly extracted, untranslated strings)
2. Find any keys in the translation file that still have English text (were not actually translated)
3. Translate the missing/untranslated strings into the appropriate language using en.json as reference
@@ -106,6 +109,8 @@ jobs:
- fr.json = French
- ko.json = Korean
- es.json = Spanish
+ - cs.json = Czech
+ - uk.json = Ukrainian
Important:
- Preserve {placeholder} variables exactly as they appear in the English strings