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

Francesco Lodolo [:flod] flod at lodolo.net
Tue Mar 7 07:06:06 UTC 2017


Il 07/03/17 02.46, Jared Hirsch ha scritto:
> Hi all,
>
> I'm working on a localization plan for Page Shot in FF 54, and I'm 
> curious if anyone on the list has suggestions (best practices or 
> gotchas) related to l10n in system addons.
>
> Page Shot includes a WebExtension (in a bootstrapped addon wrapper) 
> and a website. The site runs on nodejs and its views are built with 
> react, while the addon's views are built using raw browser APIs (DOM 
> built-ins + innerHTML). Both parts of the project live inside the same 
> Github repo.
>
> The current draft plan is to connect Pontoon to the Page Shot Github 
> repo[1] to pull in translated strings, try out fluent-react[2] for the 
> server, and fluent.js[3] for the addon. For language negotiation on 
> both addon and server, we're going to try out the fluent-langneg[4] 
> library. This plan doesn't (yet) include anything specific to Page 
> Shot shipping as a system addon. Feedback is very welcome :-)
>
> I also have two questions for folks on the list. First, for language 
> negotiation, should the addon follow the user's content language 
> preference, or should it match the UI language? Second, should we plan 
> to ship one system addon containing all locales, or should we plan to 
> build one addon for each locale?
Hi Jared,
The only localized system add-on I'm familiar with is Pocket [1], but 
the solution used for it won't be applicable to a WebExtension. Pocket 
used to ship in-tree, as part of Firefox localization, it was moved 
outside to allow out-of-cycle updates.

We use an external l10n repository (GitHub) and Pontoon to localize 
those strings, in .properties format, then dump updates periodically in 
mozilla-central. More important, Pocket uses Firefox build system, 
including its l10n bits: if a locale is missing strings, or has broken 
ones, the build system (compare-locales specifically) will integrate the 
original file with English strings. The system works, mostly because 
updates are sparse, but it's also pretty ugly [2].

I know the team behind Fluent (Stas, Zibi, and Azel) had plenty of 
discussions about content vs UI locale preferences. Axel is following 
this list, so I hope he will chime in directly ;-)

About your second question:
* We need at least a fallback to English, or a build system to rely on.
* If the plan is to fall back to another language, it also rules out a 
single-locale add-on.

If I'm not forgetting things, the only WebExtension we have localized so 
far is SnoozeTabs, and it converts from the original JSON format to a 
.properties file supported by localization tools.

Francesco

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1215694
[2] 
https://hg.mozilla.org/mozilla-central/file/tip/browser/extensions/pocket/locale/jar.mn

>
> Finally, if you'd like to follow l10n progress in Page Shot, you can 
> watch the BMO l10n kickoff bug[5] or the l10n tracking bug in the Page 
> Shot Github repo[6].
>
> Cheers,
>
> Jared
>
>
> [1] https://github.com/mozilla-services/pageshot/ 
> <https://github.com/mozilla-services/pageshot/>
> [2] 
> https://github.com/projectfluent/fluent.js/tree/master/fluent-react 
> <https://github.com/projectfluent/fluent.js/tree/master/fluent-react>
> [3] https://github.com/projectfluent/fluent.js/tree/master/fluent 
> <https://github.com/projectfluent/fluent.js/tree/master/fluent>
> [4] 
> https://github.com/projectfluent/fluent.js/tree/master/fluent-langneg 
> <https://github.com/projectfluent/fluent.js/tree/master/fluent-langneg>
> [5] https://bugzil.la/1344898
> [6] https://github.com/mozilla-services/pageshot/issues/2205 
> <https://github.com/mozilla-services/pageshot/issues/2205>
>
>
> _______________________________________________
> Gofaster mailing list
> Gofaster at mozilla.org
> https://mail.mozilla.org/listinfo/gofaster

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/gofaster/attachments/20170307/0a4b84e4/attachment.html>


More information about the Gofaster mailing list