[wp-trac] [WordPress Trac] #20491: Introduce some JavaScript i18n functions
WordPress Trac
noreply at wordpress.org
Sun Jun 26 13:59:34 UTC 2016
#20491: Introduce some JavaScript i18n functions
-------------------------+-----------------------------
Reporter: johnbillion | Owner: swissspidy
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: I18N | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: javascript
-------------------------+-----------------------------
Changes (by swissspidy):
* milestone: 4.6 => Future Release
Comment:
We've been discussing this today with @ocean90 and @omarreiss, @atimmer
and Jip from over at Yoast and after thinking intensively about it, we
reached the following conclusion:
* Developers should be able to continue using `wp_localize_script()`.
* We should not duplicate efforts. What
`wp_i18n_add_default_js_translations()` does in [attachment:20491.diff]
can be automated.
* We agreed that it makes most sens to use Jed's gettext functions and
parse translatable strings inside the JavaScript files, like we already do
with PHP. We could then have `.json` files containing these strings and
pass these over to the JS.
* Since this needs a lot of work on the WordPress.org side of things, we
have to tackle this for 4.7
* Jed hasn't been updated in a very long time. We need to ensure it stays
alive. @omarreiss will ask its developer to create a dedicated Jed team on
GitHub where we all could contribute to (instead of us/someone forking
it).
Related:
* [https://github.com/Automattic/i18n-calypso i18n-calypso] - Calypso's
wrapper around Jed, similar to what we're aiming for.
* [https://github.com/Yoast/YoastSEO.js YoastSEO.js] - Yoast's Jed
implementation
--
Ticket URL: <https://core.trac.wordpress.org/ticket/20491#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list