mozilla

Revision 296959 of Internationalization

  • Revision slug: persona/Internationalization
  • Revision title: Internationalization
  • Revision id: 296959
  • 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 into more than 45 languages (see the current list) by a team of community volunteers.

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

Contributing new translations

To contribute a new translation, please review the documentation at https://github.com/mozilla/browserid/blob/dev/docs/I18N.md and http://svn.mozilla.org/projects/l10n-misc/trunk/browserid/README.

 

Revision Source

<h2>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 into more than 45 languages (<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">see the current list</a>) by a team of community volunteers.</p>
<h2>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>
<h2 id="Contributing_new_translations">Contributing new translations</h2>
<p>To contribute a new translation, please review the documentation at <a href="https://github.com/mozilla/browserid/blob/dev/docs/I18N.md" title="https://github.com/mozilla/browserid/blob/dev/docs/I18N.md">https://github.com/mozilla/browserid/blob/dev/docs/I18N.md</a> and <a href="http://svn.mozilla.org/projects/l10n-misc/trunk/browserid/README" title="http://svn.mozilla.org/projects/l10n-misc/trunk/browserid/README">http://svn.mozilla.org/projects/l10n-misc/trunk/browserid/README</a>.</p>
<p>&nbsp;</p>
Revert to this revision