Open diox opened 5 days ago
We can see that we're correctly requesting the JS file with the translations - on dev, currently that's https://addons-dev.allizom.org/static-server/js/i18n/fr.f4d6614c81ff.js - but that file doesn't contain our strings (only the base ones from Django), despite the fact that they are translated in djangojs.po
: https://github.com/mozilla/addons-server/blob/master/locale/fr/LC_MESSAGES/djangojs.po
In the image, the fr.js
files in static-build/
and site-static/
are present but incorrect (missing our translations).
Locally manually calling generate_jsi18n_files
(and then collectstatic
for DEBUG=False
) fixes it.
I think we are putting the files created by generate_jsi18n_files
in ./static that is likely the problem as we no longer copy static into the final image. We should put those files in static-build as built assets.
We aren't. There is nothing i18n
related in static/
, and the command does use root = os.path.join(settings.STATIC_BUILD_PATH, 'js', 'i18n')
.
Note that as I said above, the file is generated. It's just generated incorrectly, without our translations (likely a dependency/ordering/mount problem in the Dockerfile
?)
This is caused by the fact that locales and assets are now built in parallel. The problem is, when we run generate_jsi18n_files
in the assets
stage, it's completely ignoring the locales
stage, so our own translations are absent. Django's are present because they are already compiled.
Technically we could move things around, make generate_jsi18n_files
part of locales
stage, since it doesn't depend on anything assets related besides the output directory, and then move the collecstatic
call to be after both assets
and locales
stages are done, towards the end of the build. I'm not sure we want to do this now, I'd rather remove some parallelism to fix the issue and worry about doing the full refactor later.
Note that we have a test for this, but it's passing in CI because we are forcing recompilation of assets before running the tests.
What happened?
/fr/developers/addon/submit/upload-listed
(use any language other than English with 100% translation completion rate in pontoon. I chose French)What did you expect to happen?
Instead we can see:
[Select a file...]
Your add-on should end with .zip, .xpi or .crx
Likely a regression from 2a64618e9d1eebaed15639fb4f824f2844c92778
Is there an existing issue for this?
┆Issue is synchronized with this Jira Task