The Tower of Babel screwed all of us. i18n is more complicated than it should be for something that everyone deals with.
By: Brad Jorsch
A lot of work has been going on in the Jetpack plugin lately. We have UIs built in React, with the JavaScript bundles being created by Webpack. We have Composer packages used for code sharing, increasingly so as we look into creating standalone plugins like Jetpack Backup and Jetpack Search. And we want everything to be translated for people who speak languages other than English.
A few months back we started getting reports that some translations in Jetpack had gone missing. As we looked into it, we eventually found no fewer thansixdifferent ways that translation was broken!
- JavaScript bundles weren’t being scanned due to bad file naming.
- Webpack’s optimizations were breaking thei18nfunction calls so WordPress.org’s translation infrastructure couldn’t find them.
- Lazy-loaded Webpack bundles weren’t lazy-loading translation data.
- Shared React component translations didn’t work in plugins other than Jetpack itself.
- Bundled Composer packages weren’t being scanned.
View original post 1,979 more words