7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-26 08:52:34 +00:00

Add missing js translations to openedx

Client-side translations are stored in "djangojs.js" files. Supposedly,
these files were properly compiled prior to the Ironwood release -- but
this is not the case, so we need to re-generate them.

Also, we need to re-generate the djangojs.js files for the custom,
downloaded locales. The assets collection settings are also fixed to
take into account the separate locale folder.

This step needs to happen prior to static assets collection, as the
djangojs files are collected to the staticfiles/ folder.

See these conversations:
https://discuss.overhang.io/t/localization-not-works-perfect/363
https://discuss.openedx.org/t/localization-not-work-for-js-files/1671
This commit is contained in:
Régis Behmo 2020-04-01 20:05:06 +02:00
parent b72da818ea
commit 1c22ade579
7 changed files with 30 additions and 0 deletions

View File

@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".
## Unreleased
- [Bugfix] Fix missing js translations
- [Bugfix] Fix tls certificate generation in cron jobs
## v3.11.6 (2020-03-13)

View File

@ -75,6 +75,12 @@ ENV CONFIG_ROOT /openedx/config
COPY settings/lms/*.py ./lms/envs/tutor/
COPY settings/cms/*.py ./cms/envs/tutor/
# Compile i18n strings: in Ironwood, js locales are not properly compiled out of the box
# and we need to do a pass ourselves. Also, we need to compile the djangojs.js files for
# the downloaded locales.
RUN ./manage.py lms --settings=tutor.i18n compilejsi18n
RUN ./manage.py cms --settings=tutor.i18n compilejsi18n
# Copy scripts
COPY ./bin /openedx/bin
RUN chmod a+x /openedx/bin/*

View File

@ -4,3 +4,5 @@ STATIC_ROOT = path(STATIC_ROOT_BASE) / 'studio'
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json"
derive_settings(__name__)
LOCALE_PATHS.append("/openedx/locale")

View File

@ -0,0 +1 @@
{% include "build/openedx/settings/partials/i18n.py" %}

View File

@ -4,3 +4,5 @@ STATIC_ROOT = path(STATIC_ROOT_BASE)
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json"
derive_settings(__name__)
LOCALE_PATHS.append("/openedx/locale")

View File

@ -0,0 +1 @@
{% include "build/openedx/settings/partials/i18n.py" %}

View File

@ -0,0 +1,17 @@
from ..common import *
from openedx.core.lib.derived import derive_settings
STATIC_ROOT_BASE = '/openedx/staticfiles'
SECRET_KEY = 'secret'
XQUEUE_INTERFACE = {
'django_auth': None,
'url': None,
}
DATABASES = {
"default": {},
}
derive_settings(__name__)
LOCALE_PATHS.append("/openedx/locale")