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

Update i18n-js to load only translations under the "js." namespace #2722

Open
kristinalim opened this issue Sep 13, 2018 · 0 comments
Open

Comments

@kristinalim
Copy link
Member

kristinalim commented Sep 13, 2018

Next step to reduce the speed and browser memory usage when loading the website

Description

Once all JS-related translations have been re-arranged (openfoodfoundation/wishlist#342), we can do this to reduce initial page size by approx ~170kb (approx ~50kb compressed over the wire, estimated in Nov 2022). It results in far less JSON for the browser to load into memory and parse.
This is estimated per language enabled on the instance, so this advantage multiplies for multi-language instances.

This was discussed here.

Expected Behavior

The browser should only have to download translations that will be used by the JS. After openfoodfoundation/wishlist#342 is done, these will be those under the "js." namespace.

Actual Behavior

All translations for each available language, even those accessed only by Ruby code, are downloaded by the browser.

Dependencies

openfoodfoundation/wishlist#342 is a prerequisite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: All the things 💤
Development

No branches or pull requests

1 participant