Hello,
I’d like to discuss how the Open edX platform is built with a restricted language list and the challenges of adding a new language.
Here’s my experience so far:
- Latvian Language Requirement: I need to have the Latvian (lv) language available on the LMS since all courses and learning activities will be conducted in Latvian, following local legislation.
- Steps Taken to Add Latvian to Open edX:
- I translated and reviewed all the *.po files in the Transifex “
opened-translations
” section. - I manually copied the translated files to the “
opened-translations-redwood
” section, which unexpectedly appeared when I was nearly done with the translations. Unfortunately,opened-translations-redwood
section didn’t reflect the changes I had made in theopened-translations
. - I verified that Latvian (lv) is included in the GitHub
openedx/openedx-translations
list.
Now, I’m trying to get Latvian working in my Open edX Tutor installation, but I’ve been struggling with several issues:
- Language Setting Error: During the interactive setup process with the
tutor local launch
command, where users can set the default language, I encountered the following error:
The default language code for the platform [en] lv
Error: 'lv' is not one of 'en', 'am', 'ar', 'az', 'bg-bg', 'bn-bd', 'bn-in', 'bs ', 'ca', 'ca@valencia', 'cs', 'cy', 'da', 'de-de', 'el', 'en-uk', 'en@lolcat', 'en@pirate', 'es-419', 'es-ar', 'es-ec', 'es-es', 'es-mx', 'es-pe', 'et-ee', 'eu-es', 'fa', 'fa-ir', 'fi-fi', 'fil', 'fr', 'gl', 'gu', 'he', 'hi', 'hr', 'hu', 'hy-am', 'id', 'it-it', 'ja-jp', 'kk-kz', 'km-kh', 'kn', 'ko-kr', 'lt-lt', 'ml', 'mn', 'mr', 'ms', 'nb', 'ne', 'nl-nl', 'or', 'pl', 'pt-br', 'pt-pt', 'ro', 'ru', 'si', 'sk', 'sl', 'sq', 'sr', 'sv', 'sw-ke', 'ta', 'te', 'th', 'tr-tr', 'uk', 'ur', 'vi', 'uz', 'zh-cn', 'zh-hk', 'zh-tw'.
To resolve this, I found the Interactive.py file where this list is hardcoded and added “lv” to the list, allowing me to proceed with the installation. However, this led to another error:
Loading settings lms.envs.tutor.production >>>>
SystemCheckError: System check identified some issues:
ERRORS:
?: (translation.E004) You have provided a value for the LANGUAGE_CODE setting that is not in the LANGUAGES setting.
Thanks to @omar, I was directed to two files where Latvian should be added: edx-platform/…/common.py and frontend-app-account/…/constants.js. I’m now trying to figure out how to correctly add the necessary lines for Latvian to these files.
Any guidelines, assistance, or shared experiences wit this would be greatly appreciated.
Questions and Concerns:
- How can a new language be added to the list? What is the process to edit these files and add a language? Why is this list as it is, and where is it derived from? Why does the language list vary across different sources?
- Why is language checked against a predefined list? Can this approach be revisited to make the language settings more flexible?
- Could the process of installing language packs and locale settings be incorporated into Tutor based on user input, with a fallback to English (en) if the chosen translation is unavailable?
- Localization during Installation: I also noticed during the initial stages of the Open edX Docker image creation that various English locales are installed by default, which are unnecessary for my installation. Could the locale settings be tied to the selected default language?
Any guidance or suggestions on how to address these challenges would be greatly appreciated.
Thank you!