[Go Faster] L10n for system addons (Page Shot in 54)

Jared Hirsch 6a68 at mozilla.com
Tue Mar 14 21:00:49 UTC 2017


Hi all,

Thanks for the feedback. A quick update on the final l10n implementation 
details:

I wound up using the WebExtension i18n API in the addon, because it was by 
far the simplest solution. Because this API falls back to a default locale 
if strings are missing, it makes sense to ship one system addon containing 
all locales, rather than many addons with one locale each.

To transform strings from Pontoon's format and file location to that 
expected by the i18n API, I reused the pontoon-to-webext script[1] from the 
Snooze Tabs experiment (thanks to @flod, who pointed me at it). It worked 
perfectly, and I believe Blake is going to publish it on npm as a 
standalone package.

The content language vs UI language question is still open. By default, 
WebExtension i18n uses the UI language, and the website will use the 
content language (the Accept-Language header). It's not yet clear what we 
should do if these languages differ; this issue is being tracked at [2].

Cheers,

Jared

[1] 
https://github.com/bwinton/SnoozeTabs/blob/master/bin/pontoon-to-webext.js
[2] https://github.com/mozilla-services/pageshot/issues/2374

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/gofaster/attachments/20170314/6b83fc26/attachment.html>


More information about the Gofaster mailing list