-
Task
-
Resolution: Unresolved
-
Should have
-
None
-
None
-
Code Refactoring, Performance, Technical Debt
-
proteus
We need to load wp-i18n in the front end partially because the FrontendRichText component includes labels that are only used in the editor. These need to be translated, and this happens in the block's attributes. The block then internally doesn't use these on the front end.
wp-i18n in turn depends on wp-polyfill, which we otherwise wouldn't need to load.
There's also this code in master piece that depends on wp-i18n, but it seems easy to avoid. It's 2 calls, the second actually does a loop for each country group letter and creates a separate label. We can check if people actually translate these for each letter. Both translations are only used in the aria-label.
If we separate out the admin area code, similar to how it happens in other components, we would not have to load wp-i18n and wp-polyfill anymore.
Perhaps a quicker fix would be to catch __ if it's not defined and assign a noop function to it.
const __ = wp.i18n?.__ || s => s;
- has to be done before
-
PLANET-5662 Use Preact instead of core WP React on the frontend
- OPEN