Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISG for i18n js catalogs #22742

Closed
wants to merge 4 commits into from
Closed

ISG for i18n js catalogs #22742

wants to merge 4 commits into from

Conversation

KevinMind
Copy link
Contributor

@KevinMind KevinMind commented Oct 9, 2024

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.

make up DOCKER_TARGET=development COMPOSE_FILE=docker-compose.yml

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

make up DOCKER_TARGET=production COMPOSE_FILE=docker-compose.yml:docker-compose.ci.yml

NOTE: prod mode is partially broken now, the make up will never complete, but the containers are probably running. Try the same request again.

Now the file should include our specific localized strings. (try a different language to make sure)

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind force-pushed the isg-locales branch 7 times, most recently from 747e920 to ff765d4 Compare October 9, 2024 14:24
@KevinMind KevinMind closed this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant