Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no files newer than the marker are found after running the command then we show the message ya? I mentally parsed out this bash and it looks right to me too.

Did you test out the idea with known newer files or otherwise force the situation you expect to trigger this error w/ test files or something to be sure (or see it work by triggering the error?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally didn't, but I did watch Claude Code do this exact test in front of me - I am happy to reproduce the experiment to validate though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the simplest way to test this was just to run this with and without the crowdin download commented out - with it commented out I got this output:

yarn run makemessages
yarn run v1.22.22
$ kolibri-i18n extract-messages --pluginFile ./build_tools/build_plugins.txt --namespace kolibri-common --searchPath ./packages/kolibri-common --namespace kolibri-core --searchPath ./packages/kolibri
Gathering relevant modules from ['kolibri.core', 'kolibri.plugins.*']
Writing webpack_json output to /tmp/20251116-1590230-1bij8nv.5g3m.json
INFO: Writing webpack_json output to /tmp/20251116-1590230-1bij8nv.5g3m.json
[WARN: root] Skipping /var/home/richard/github/kolibri/kolibri/plugins/coach/assets/src/views/common/LearnerExerciseReport.vue because $trs property was given an empty object
Done in 4.42s.
touch kolibri/locale/.crowdin-download-marker
❌ ERROR: No translation files were downloaded - Crowdin download may have failed silently
Check the output above for errors during the download process
make: *** [Makefile:238: i18n-download-translations] Error 1

With it still included, I got a 0 error code and plenty of messages!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w00t! right on thanks for running it through to be sure :)

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
Expand Down