Internationalization

  • Revision slug: Mozilla/Persona/Internationalization
  • Revision title: Internationalization
  • Revision id: 448741
  • Created:
  • Creator: jswisher
  • Is current revision? Yes
  • Comment Revert to revision of 2013-05-10 15:02:31 by Sheppy: "Spanish translation in the English text"

Revision Content

What's localized in Persona

In the future, the user interface for signing into sites with Persona will be directly integrated into the browser, and thus localized along with the browser's own localization. For browsers without integrated support, Persona's user interface consists of a series of dialogs served from login.persona.org. These dialogs are translated by a team of community volunteers, and more than 45 locales are currently enabled in production.

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.

How you can help

Persona uses Mozilla Verbatim to help volunteers create new translations. If you want to help out, read about getting started with Verbatim and check out the "BrowserID" project on Verbatim.

 

Revision Source

<h2 id="What's_localized_in_Persona">What's localized in Persona</h2>
<p>In the future, the user interface for signing into sites with Persona will be directly integrated into the browser, and thus localized along with the browser's own localization. For browsers without integrated support, Persona's user interface consists of a series of dialogs served from <a href="https://login.persona.org" title="https://login.persona.org">login.persona.org</a>. These dialogs are translated by a team of community volunteers, and more than 45 locales are currently <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">enabled in production</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="How_you_can_help">How you can help</h2>
<p>Persona uses Mozilla Verbatim to help volunteers create new translations. If you want to help out, read about <a href="https://developer.mozilla.org/en-US/docs/Localizing_with_Verbatim" title="https://developer.mozilla.org/en-US/docs/Localizing_with_Verbatim">getting started with Verbatim</a> and check out the <a href="https://localize.mozilla.org/projects/browserid/" title="https://localize.mozilla.org/projects/browserid/">"BrowserID" project</a> on Verbatim.</p>
<p>&nbsp;</p>
Revert to this revision