mozilla

Revision 297126 of Internationalization

  • Revision slug: persona/Internationalization
  • Revision title: Internationalization
  • Revision id: 297126
  • Created:
  • Creator: wbamberg
  • Is current revision? No
  • Comment
Tags: 

Revision Content

What's localized in Persona

When a user tries to sign into a website using Persona, they are guided through the process of signing up or signing in.

If they haven't signed in using Persona before, this involves choosing a new password and an email address to use, then proving ownership of that email address. If the email address they want to use is already known to Persona, this may involve them entering a password or simply selecting that email address.

In the future, the user interface for all this is will be integrated into the browser, and localized along with the browser's own localization. Until then, the user interface consists of a series of dialogs served from https://login.persona.org/, via the website's inclusion of https://login.persona.org/include.js.

The Persona dialogs and login.persona.org website are translated by a team of community volunteers. You can find the set of locales currently in production in the Persona GitHub repository.

How Persona chooses localizations

The Persona service selects a language using the Accept-Language header sent alongside the browser's requests. The algorithm used to map an Accept-Language header to a language is the same as that used by mozilla.org:

  1. For each language tag in the Accept-Language header:
    • check if we have an exact match for the language identified by the language tag
    • check if we have an exact match for the language identified by the first part of the language tag
  2. If a match can't be made using rule (1), fall back to en-US. However, en or en-US is almost always the last accept-lang header sent by most browsers.

For example, the table below lists the language selected for various Accept-Language headers, if the following locales were supported: en-US, es, es-MX:

Accept-Language Header Selected language
es-AR,es;q=0.8,en-us;q=0.5 es
es-MX,es;q=0.8,en-us;q=0.5 es-MX
es-es,en-us;q=0.5 en-US
es-es en-US

There is currently no way for a website to force the dialogs to appear in another language. This is because the Persona UI is logically (and in future native implementations will actually be) part of the browser UI, so its language should be consistent with the language selected for the browser.

Contributing new translations

To help the Persona project by adding support for more locales, visit its page on localize.mozilla.org.

 

Revision Source

<h2 id="What's_localized_in_Persona">What's localized in Persona</h2>
<p>When a user tries to sign into a website using Persona, they are guided through the process of signing up or signing in.<br />
  <br />
  If they haven't signed in using Persona before, this involves choosing a new password and an email address to use, then proving ownership of that email address. If the email address they want to use is already known to Persona, this may involve them entering a password or simply selecting that email address.<br />
  <br />
  In the future, the user interface for all this is will be integrated into the browser, and localized along with the browser's own localization. Until then, the user interface consists of a series of dialogs served from <code>https://login.persona.org/</code>, via the website's inclusion of <code>https://login.persona.org/include.js</code>.</p>
<p>The Persona dialogs and <a href="https://login.persona.org" title="https://login.persona.org">login.persona.org</a> website are translated by a team of community volunteers. You can find the set of locales currently in production in the <a href="https://github.com/mozilla/browserid/blob/dev/config/l10n-prod.json" title="https://github.com/mozilla/browserid/blob/dev/config/l10n-prod.json">Persona GitHub repository</a>.</p>
<h2 id="How_Persona_chooses_localizations">How Persona chooses localizations</h2>
<p>The Persona service selects a language using the <code>Accept-Language</code> header sent alongside the browser's requests. The algorithm used to map an <code>Accept-Language</code> header to a language is the same as that used by <code>mozilla.org</code>:</p>
<ol>
  <li>For each language tag in the <code>Accept-Language</code> header:
    <ul>
      <li>check if we have an exact match for the language identified by the language tag</li>
      <li>check if we have an exact match for the language identified by the first part of the language tag</li>
    </ul>
  </li>
  <li>If a match can't be made using rule (1), fall back to en-US. However, en or en-US is almost always the last accept-lang header sent by most browsers.</li>
</ol>
<p>For example, the table below lists the language selected for various <code>Accept-Language</code> headers, if the following locales were supported: <code>en-US, es, es-MX</code>:</p>
<table>
  <thead>
    <tr>
      <th scope="col"><strong>Accept-Language Header</strong></th>
      <th scope="col"><strong>Selected language</strong></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>es-AR,es;q=0.8,en-us;q=0.5</code></td>
      <td><code>es</code></td>
    </tr>
    <tr>
      <td><code>es-MX,es;q=0.8,en-us;q=0.5</code></td>
      <td><code>es-MX</code></td>
    </tr>
    <tr>
      <td><code>e</code><code>s-es,en-us;q=0.5</code></td>
      <td><code>en-US</code></td>
    </tr>
    <tr>
      <td><code>e</code><code>s-es</code></td>
      <td><code>en-US</code></td>
    </tr>
  </tbody>
</table>
<p>There is currently no way for a website to force the dialogs to appear in another language. This is because the Persona UI is logically (and in future native implementations will actually be) part of the browser UI, so its language should be consistent with the language selected for the browser.</p>
<h2 id="Contributing_new_translations">Contributing new translations</h2>
<p>To help the Persona project by adding support for more locales, visit its page on <a href="https://localize.mozilla.org/projects/browserid/" title="https://localize.mozilla.org/projects/browserid/">localize.mozilla.org</a>.</p>
<p>&nbsp;</p>
Revert to this revision