Switch away from @eventespresso/i18n and use @wordpress/i18n directly (wip) #769
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.
Problem this Pull Request solves
A while ago, I started using
@eventespresso/i18n
as a way to get around the fact that we started using wp.i18n functionality in environments that may not havewp.i18n
so it was a way to ensure we could just use it anywhere (basicallyeejs.i18n
is just a wrapper around the@wordpress/i18n
package).However, now that the release of WP5.0 is imminent, I think it'd be better for long term maintenance if we start using
@wordpress/i18n
everywhere instead and I can just give it the same treatment that I did for bundled vendor scripts in WordPress (such asreact
). So essentially just copying thewp.i18n
package into theassets/vendors
directory and registering it on thewpi18n
handle if its not already registered in WP.Note: this is not an urgent requirement and can be done "whenever". It's more of an optimization thing (and reduces maintenance overhead). When I implement, I can just alias
@eventespresso/i18n
to thewp.i18n
external instead ofeejs.i18n
.How has this been tested
Checklist
esc_html__()
, see https://codex.wordpress.org/I18n_for_WordPress_Developers)