Page MenuHomePhabricator

Allow loading only the required i18n files
Open, Needs TriagePublic

Description

All i18n files are loaded in the Wikipedia Preview bundle (including qqq). This is easy and convenient, especially when using the detect links feature since an article can link to any site in any language and all resources are available right away.

However, once we extract the style, this takes up half the bundle size.

In an environment like the WordPress plugin, we can know which languages are needed on any given page and include only the needed resources. To do that, we first need a way for Wikipedia Preview to not include the i18n in the bundle but output those files to dist, packaged in such a way that they register themselves with Wikipedia Preview when loaded.