Hello,
I am new to tutor, and was trying to work on translation
I put in my custom translations for login and registration page through this command
nano "$(tutor config printroot)/env/build/openedx/locale/vi/LC_MESSAGES/djangojs.po"
And post this I build the image but that leads to an error as following :
Traceback (most recent call last):
File "./manage.py", line 123, in <module>
execute_from_command_line([sys.argv[0]] + django_args)
File "/openedx/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/openedx/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/openedx/venv/lib/python3.8/site-packages/statici18n/management/commands/compilejsi18n.py", line 150, in handle
self._create_output(
File "/openedx/venv/lib/python3.8/site-packages/statici18n/management/commands/compilejsi18n.py", line 114, in _create_output
data = self._create_javascript_catalog(locale, domain, packages)
File "/openedx/venv/lib/python3.8/site-packages/statici18n/management/commands/compilejsi18n.py", line 93, in _create_javascript_catalog
response = catalog.get(self, None, domain=domain, packages=packages)
File "/openedx/venv/lib/python3.8/site-packages/django/views/i18n.py", line 201, in get
self.translation = DjangoTranslation(locale, domain=domain, localedirs=paths)
File "/openedx/venv/lib/python3.8/site-packages/django/utils/translation/trans_real.py", line 156, in __init__
self._add_local_translations()
File "/openedx/venv/lib/python3.8/site-packages/django/utils/translation/trans_real.py", line 208, in _add_local_translations
translation = self._new_gnu_trans(localedir)
File "/openedx/venv/lib/python3.8/site-packages/django/utils/translation/trans_real.py", line 176, in _new_gnu_trans
return gettext_module.translation(
File "/opt/pyenv/versions/3.8.6/lib/python3.8/gettext.py", line 598, in translation
t = _translations.setdefault(key, class_(fp))
File "/opt/pyenv/versions/3.8.6/lib/python3.8/gettext.py", line 261, in __init__
self._parse(fp)
File "/opt/pyenv/versions/3.8.6/lib/python3.8/gettext.py", line 456, in _parse
catalog[str(msg, charset)] = str(tmsg, charset)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 1: ordinal not in range(128)
Now, from what I understand is that probably this file is being copied or it’s content are being copied to edx’s conf/locale
So I translated the files in my local (non tutor, normal edx devstack) and it works there.
I pushed .mo files into repo and tried to build the repo from there using following command
tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY=MY-REPO --build-arg EDX_PLATFORM_VERSION=MY-BRANCH
And that followed by
tutor local stop
tutor local start -d
tutor local restart
That gave me no results, if I change the content of the file that gets reflected, however the translation does not.
Those translations are not easy and direct to put up they require more than normal steps (shown in the post here)
And I try to run those commands
for example
tutor dev run lms paver i18n_fastgenerate
and have also tried to build the assets through tutor command
tutor local run lms openedx-assets build
but that also fetches no result.
Open edx version: koa
Tag: open-release/koa.2
Tutor version : tutor, version 11.2.2
Operating system: 20.04