Migrate i18n to crowdin-cli and kolibri-build/kolibri-i18n#5831
Migrate i18n to crowdin-cli and kolibri-build/kolibri-i18n#5831rtibbles merged 3 commits intolearningequality:unstablefrom
Conversation
Replace the custom Python crowdin API script with the official crowdin-cli tool. Add crowdin.yml config with language mappings and GitHub Actions workflows for upload/download. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace kolibri-tools with kolibri-build (webpack/babel config) and kolibri-i18n (message extraction, code-gen). Update package scripts, dependabot config, and workspace settings accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Make i18nSetup async with dynamic imports for locale data, matching Kolibri's pattern. Switch from vue-jest to @vue/vue2-jest for proper Vue 2.7 <script setup> support. Update LoadingText.vue to use shared translator strings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| * kolibri-build's WebpackRTLPlugin injects runtime code that accesses | ||
| * window.kolibriCoreAppGlobal["kolibri/rtlcss"].rtlManager to handle | ||
| * dynamic RTL CSS chunk loading. Studio doesn't use this mechanism | ||
| * (RTL CSS is served directly by Django), so we provide a passthrough |
There was a problem hiding this comment.
learn something new every day!
marcellamaki
left a comment
There was a problem hiding this comment.
I am approving because there was only one small deviation from the cross referencing i did with kolibri and i don't know whether or not it's a blocker. if not, fine to proceed. otherwise i would defer to richard anyways
| @@ -0,0 +1,45 @@ | |||
| # | |||
There was a problem hiding this comment.
cross referenced with Kolibri -- looks good
| # finds only the .po files nested there. | ||
| cd contentcuration && python manage.py compilemessages | ||
|
|
||
| CROWDIN_BRANCH ?= unstable |
There was a problem hiding this comment.
I truly do not know if this is important but in Kolibri this is
CROWDIN_BRANCH := release
ETA here meaning the difference being ?= vs := not branhc name
There was a problem hiding this comment.
?= technically allows the value to be overridden by the command line - I left it like this just in case we have a specific need to override, but I don't think it matters.
| settings: ['./settings/index.js'], | ||
| accounts: ['./accounts/index.js'], | ||
| administration: ['./administration/index.js'], | ||
| // The rtlcss-stub must come first to set up the window global before any CSS chunk loading. |
Summary
Migrate Studio's i18n infrastructure to use the same architecture as Kolibri:
crowdin.pyAPI script with the officialcrowdin-clitool, addingcrowdin.ymlconfig and GitHub Actions workflows for upload/downloadkolibri-toolswithkolibri-build(webpack/babel config) andkolibri-i18n(message extraction, code-gen), including a stub for kolibri-build's RTL CSS runtime module which Studio doesn't usei18nSetupasync with dynamic imports for locale data (matching Kolibri's pattern), upgrade to@vue/vue2-jestfor proper<script setup>supportReferences
learningequality/kolibricrowdin.ymllearningequality/kolibri.github/workflows/i18n-upload.yml/i18n-download.ymlReviewer guidance
crowdin.ymllanguage mappings should be verified against the 5 languages currently on the Crowdin project (ar, es-ES, fr, hi, pt-BR)contentcuration/contentcuration/frontend/shared/rtlcss-stub.jsis a passthrough stub — kolibri-build's RTL plugin injects runtime code for dynamic RTL CSS chunk loading, but Studio does not code-split CSS assets yet, so the dynamic loading isn't neededi18nSetupchange relies on Jest 30's support for asyncsetupFilesAfterEnvexportsAI usage
Used Claude Code throughout to implement the migration, guided by Kolibri's existing patterns. All changes were reviewed and verified — production build, full test suite (2099 passing), linting, and manual runtime console check.