diff --git a/.github/workflows/i18n-download.yml b/.github/workflows/i18n-download.yml index ea09e75ed6f..4b58293fe7c 100644 --- a/.github/workflows/i18n-download.yml +++ b/.github/workflows/i18n-download.yml @@ -28,6 +28,12 @@ jobs: node-version: '20.x' cache: 'yarn' + - name: Setup Java for crowdin-cli + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '17' + - name: Install gettext run: sudo apt-get update && sudo apt-get install -y gettext diff --git a/.github/workflows/i18n-upload.yml b/.github/workflows/i18n-upload.yml index 7bee34b9715..d3d8c5351f3 100644 --- a/.github/workflows/i18n-upload.yml +++ b/.github/workflows/i18n-upload.yml @@ -24,6 +24,12 @@ jobs: node-version: '20.x' cache: 'yarn' + - name: Setup Java for crowdin-cli + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '17' + - name: Install gettext run: sudo apt-get update && sudo apt-get install -y gettext diff --git a/.gitignore b/.gitignore index 77ed346c1f3..da290db7748 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ kolibrihome_test/ # Translations kolibri/locale/**/LC_MESSAGES/*.csv kolibri/locale/en/LC_MESSAGES/profiles/* +kolibri/locale/.crowdin-download-marker # Mr Developer .mr.developer.cfg diff --git a/Makefile b/Makefile index c53c10b4478..4b9b495a80f 100644 --- a/Makefile +++ b/Makefile @@ -234,7 +234,16 @@ i18n-pretranslate-approve-all: yarn exec crowdin pre-translate -- --branch ${CROWDIN_BRANCH} --translate-untranslated-only --method=tm --auto-approve-option=all i18n-download-translations: i18n-extract-frontend + touch kolibri/locale/.crowdin-download-marker yarn exec crowdin download -- --branch ${CROWDIN_BRANCH} + @if [ -z "$$(find kolibri/locale/*/LC_MESSAGES -type f \( -name '*.po' -o -name '*.csv' \) -newer kolibri/locale/.crowdin-download-marker 2>/dev/null)" ]; then \ + echo "❌ ERROR: No translation files were downloaded - Crowdin download may have failed silently"; \ + echo "Check the output above for errors during the download process"; \ + rm -f kolibri/locale/.crowdin-download-marker; \ + exit 1; \ + fi + @echo "✅ Translation files downloaded successfully" + rm -f kolibri/locale/.crowdin-download-marker python build_tools/i18n/cleanup_unsupported_languages.py yarn exec kolibri-i18n code-gen -- --output-dir ./packages/kolibri/utils/internal $(MAKE) i18n-django-compilemessages