Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to: mozilla/addons#15048
Description
In dev mode, render static/i18n/.js files dynamically to remove the need to render them at build time.
Context
Currently we pre-generate all static locale modules at build time. This introduces a lot of dependencies in even our development build that slow things down and are otherwise not necessary.
By enabling dynamic generation in dev mode we remove the need for these build time dependencies, improving the speed of our development start time.
Currently, the development build would also not include locales.. that means the generated i18n modules do not include our actual translations.
This can be fixed in a separate PR as it is not a critical bug and doesn't impact non develoers.
Testing
Dev
Run make up in dev mode and verify that locales are rendering correctly.
Request
http://olympia.test/static/js/i18n/en-US.js
you should get back a javascript file that does NOT include our own localized strings, but only the django defaults. Text should still render in english as we use the gettext fallback strings.Also, you should inspect the container files.. the
/data/olympia/site-static
and/data/olympia/static-build
directories should be empty.Prod
Now do the same in prod mode
Now the file should include our specific localized strings. (try a different language to make sure)
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.