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

i18n: Allow setting locale data by domain #5489

merged 2 commits into from Mar 14, 2018


Copy link

commented Mar 8, 2018

Closes #5168
Cherry-picks 685eaf0 from #5481

This pull request seeks to enable a plugin to inject their own domain locale data into the global wp.i18n module, refactoring gutenberg_get_jed_locale_data as a general-purpose Jed locale formatter (removing previous assumptions of being the default domain).


wp.i18n.setLocaleData( { '': {}, foo: [ 'bar' ] }, 'myplugin' )
console.log( wp.i18n.__( 'foo', 'myplugin' ) );
// "bar"

Testing instructions:

Verify that there are no regressions in the display of default localized strings for Gutenberg.

Try the example above in your browser console while on the Gutenberg screen, verifying that "bar" is logged to the console.


This comment has been minimized.

Copy link

commented Mar 13, 2018

Would love to see that merged, we are trying to get that localization going for The Events Calendar compatibility. 🖤

@aduth aduth merged commit 955f7b7 into master Mar 14, 2018

2 checks passed

codecov/project 40.05% (+0.06%) compared to b1e85f5
continuous-integration/travis-ci/pr The Travis CI build passed

@aduth aduth deleted the add/set-locale-data-domain branch Mar 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.