Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Plan localization #2205

Closed
ianb opened this issue Feb 22, 2017 · 16 comments
Closed

Plan localization #2205

ianb opened this issue Feb 22, 2017 · 16 comments
Assignees
Milestone

Comments

@ianb
Copy link
Contributor

ianb commented Feb 22, 2017

We should have a plan for how to implement localization across the website and add-on.

Questions:

  • What library do we use on the server?
  • What library do we use in the add-on?
    • The WebExtensions i18n API, plus the pontoon-to-webext transform script borrowed from the SnoozeTabs repo
  • How do we test that we've gotten all the strings?
    • (Possible answer) Pontoon typically adds locales to a repo by committing changes to the master branch directly. We would then package up whatever languages were in the repo when we cut a release.
  • How do we determine the locale? How do we make sure it's the same from the server and add-on's perspective?
    • The WebExtension i18n API auto-detects the user's locale. Unfortunately, it uses the UI language (language of Firefox), not the content language (language configured by user in Preferences for viewing websites).
    • On the server, we can try using fluent-langneg, an isomorphic language negotiation library, to get either the Accept-Languages header or the value of navigator.languages.
  • How do we ship strings to Pontoon?
@ianb ianb added this to the Sprint 54.1 milestone Feb 22, 2017
@pdehaan
Copy link
Collaborator

pdehaan commented Feb 22, 2017

Ref: #865

@ghost
Copy link

ghost commented Feb 28, 2017

MattN is having this same discussion with the L10n team for their system add-on and he said he'd have it on the Go Faster list so we could follow along.

He's using Pocket as a model which uses .properties files on github (https://github.com/mozilla-l10n/pocket-l10n ) localized by Pontoon.

@jaredhirsch jaredhirsch self-assigned this Mar 1, 2017
@jaredhirsch
Copy link
Member

Looks like this one is still up for grabs, so I'll take it

@jaredhirsch
Copy link
Member

@ianb
Copy link
Contributor Author

ianb commented Mar 2, 2017

Seems like we should loop in l10n people on this soon. @ckprice ? (Probably via bugzilla ticket)

@jaredhirsch
Copy link
Member

@ianb Yup, the l10n wiki page I linked above suggests opening a bugzilla bug for l10n planning. I can open that bug.

@ckprice ckprice modified the milestones: Sprint 54.2, Sprint 54.1 Mar 2, 2017
@jaredhirsch
Copy link
Member

I"ll also ping MattN to see what's happening

@ianb
Copy link
Contributor Author

ianb commented Mar 3, 2017

I notice that there's some WebExtension i18n support: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/i18n

@jaredhirsch
Copy link
Member

Pinged #l10n to ask about some stuff, and @flodolo mentioned that the i18n WebExtension library has some shortcomings, both with the localization aspect (plural forms are not supported), as well as technical aspects (the JSON format is incompatible with Pontoon, requiring an additional build step).

Given the react vs l20n.js issues we've seen with test pilot (two libraries racing to modify the DOM), fluent-react seems like the nicest library available: https://www.npmjs.com/package/fluent-react

@flodolo
Copy link
Collaborator

flodolo commented Mar 6, 2017

CC @stasm

@jaredhirsch
Copy link
Member

I've updated this bug's description with a draft plan, and started a discussion thread on the go-faster list (also CC'd the pageshot-staff list): https://mail.mozilla.org/pipermail/gofaster/2017-March/000626.html

@stasm
Copy link
Contributor

stasm commented Mar 7, 2017

What library do we use on the server? — (Possible solution) The fluent-react library
What library do we use in the add-on? — (Possible solution) The fluent.js library

fluent.js is a monorepo with a number of packages in it. The fluent package is very low-level. For instance, it powers the fluent-react package. As a standalone solution, fluent might be a bit too bare-bones. What is the addon's UI written in? Is it React? Also, what do you mean by "on the server"?

@jaredhirsch
Copy link
Member

@stasm The addon UI is built using innerHTML and DOM APIs, so a low-level tool should be fine, or we can try l20n.js or whatever other tool you'd suggest. This gist lists all the strings in the addon, along with the files where they are found; the paths are relative to the top-level webextension folder.

@jaredhirsch
Copy link
Member

As an update, I wound up using the WebExtension i18n library in the add-on. See #2294 for details and links to PRs.

@ghost ghost modified the milestones: Sprint 54.2, Sprint 54.3 Mar 20, 2017
@jaredhirsch
Copy link
Member

I think we have the addon part of localization completely planned out at this point, so I'm going to remove the 'beta blocker' label and tweak the title.

@jaredhirsch jaredhirsch changed the title Plan localization Plan server localization Mar 20, 2017
@jaredhirsch
Copy link
Member

Hmm. Actually, we have a plan for server localization, too. So, I'm going to go ahead and close this.

@jaredhirsch jaredhirsch changed the title Plan server localization Plan localization Mar 20, 2017
jaredhirsch added a commit that referenced this issue Jul 12, 2017
jaredhirsch added a commit that referenced this issue Jul 12, 2017
jaredhirsch added a commit that referenced this issue Jul 12, 2017
jaredhirsch added a commit that referenced this issue Jul 12, 2017
jaredhirsch added a commit that referenced this issue Jul 14, 2017
jaredhirsch added a commit that referenced this issue Jul 18, 2017
jaredhirsch added a commit that referenced this issue Jul 18, 2017
jaredhirsch added a commit that referenced this issue Jul 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants