Localizing with Narro

Narro is a handy web-based translation tool for translating a multitude of Mozilla projects. With Narro, you can translate Mozilla applications online, export files in a zip archive, or generate a .XPI file that can be installed locally for testing. After you have set up a project once, Narro uses translation memory (TM) from your translations to leverage your translated content. The TM feature lets you focus on the new, untranslated strings with each new Mozilla project release and not on re-translating strings from previously translated versions.

This document will walk you through the process of setting up a new locale and project in Narro. Using Firefox as an example, we will cover how to start a new project in Narro, how to use Narro to translate the application, and how to export your translations for testing in a local build of Firefox.

To learn about updates and changes to the Narro project, visit the Narro project blog and web-based tool site. Below you'll find a list of tools that are prerequisite to localizing with Narro.


Registering with Narro

Before you can do anything else in Narro, you need to set up your user account. Clicking the link in the top right corner of the Narro homepage will lead to you where you can register your user account. Once you've registered and logged in, you will see all of the different locales available to work on in the drop down menu in the top right corner.

For our purposes, we'll call our new locale X-testing. Perform the following steps to set up your new localization.

  1. Contact the Mozilla l10n drivers to ask if your localization effort already exists.
  2. If no volunteer effort exists, email the l10n drivers and ask the Narro global administrator to start a new localization in Narro for your locale. In your email, please provide the following information:
    • your user name
    • language
    • a bribe. Baked goods are always a good bribe :-)

      Alternately, if a volunteer effort does already exist, get in touch with your l10n community and ask them about how you can get involved!

  1. After doing this, you should receive the maintenance rights (i.e., export, import, and approval permissions) for the new localization.
  2. After receiving these rights, log out and log in again to activate them.

The image below is the screen you will see once you log in to activate your maintenance rights.

manage a locale.png


Note: If you're joining an existing effort, feel free to skip this section. That is, unless you're interested in learning how to use the import utility. In which case, we won't stop you.

Congratulations, you're now ready to import your Firefox project's source files! The import utility, found under the Import tab of your Firefox project, will provide you with several options for importing files for translation. The great thing about this utility is that it is completely automated! You only have to manually import your source files once and then never have to worry about it again The import utility imports files nightly so that if a string was added or changed one day, you'll see it in your list of untranslated strings the very next day. Now, let's go over how to set up your project's import utility.

  1. You will see a list of inactive project links with various names (e.g., Firefox Aurora, Firefox Release, etc.). Click on the link of the project you wish to activate. In this case, we will click on Firefox Aurora.
  2. By default you are taken to the Overview tab. Navigate to the Import tag to find the import utility.
  3. Once there, you will find these import sections:
    • Translations - for importing already translated project files (xx_XX)
    • Options - checkboxes for configuring your import
    • Operation log - description of the import function as it is being executed.
  4. In the Translations section you will see the default location of the nightly updated source files for your project. Make sure that all checkboxes in Options are unchecked for this first import.
  5. Click on the Import button. The Operation log will display a message once the import has completed successfully.

The image below is what you should see upon completing the import.


Now you are ready to begin translating your project!


With the new locale established in Narro, you can now start translating online in Narro. One quick way to start is to click on the Translate tab and you will be taken to a screen with sets of untranslated content. A fresh import of Firefox Aurora (as of Firefox 7) contains 5,671 English strings.

Ironically, when you first begin translating, you will see that the first few entries of the region.properties file that should not be translated using Narro. You will encounter some of these entries as you proceed through the translation. A good guideline to help you distinguish between translatable and non-translatable strings is to see if the entry can be categorized as either of the following:

  • If it is a product name, do not translate.
  • Any entries of pure code (e.g., %s), do not translate.

Anything that does not fall into these categories is translatable. Advance forward to translatable entries to begin translating. 


For the purpose of this document, we'll actually start by finding stings from two different types of files (DTD and property files). We'll make changes to those entries so that you can see them in your UI.


Example 1: The DTD file searchbar.dtd

Narro allows you to search for particular strings. For this example, we'll search for the DTD file (often called an entity) named searchbar.dtd that contains the string Manage Search Engines... You can easily find this string in the browser UI by clicking on the drop-down arrow in the search box in the upper-right corner of your browser. Take a look at the image below. At the bottom of the list of search engines that appears, you'll see Manage Search Engines...

Add %S.png

Here is how you can use Narro to translate the Manage Search Engines... element:

  1. Navigate to the Translate tab in the Firefox Aurora project.
  2. Enter the string "Manage Search Engines..." in the Search field and click Search.

Manage Search Engines.png

  1. Click on the text box underneath the search result. This will expand the text box and highlight it in green to display the active entry.
  2. Enter your translation and press Save.

In the example below, you will see that the Manage Search Engines... element has been translated to MANAGE SEARCH ENGINES.

You will also note that there are two additional strings below your translation. These are matches from previous translations that members of your community may have provided. The arrows on the right allow you to vote on a translation for the active string. Those that are voted to the top of the list are entered into the translation memory.

approved translation.png

As you translate these types of DTD files, you can periodically export an .xpi file (also known as a language pack) that you can install on Firefox. We will discuss how to do that in a later section. Next time you install the testable language pack, you'll see the MANAGE SEARCH ENGINES string translated in the UI of your local version of Firefox.


Example 2: The property file search.properties

The property file search.properties contains the string Add %S. You can easily find this string in the browser UI by visiting a website that provides a search plugin (like http://developer.mozilla.org/) and clicking on the drop-down arrow in the search box in the upper-right corner of your browser. Take a look at the image below. There you'll see Add %S, where %S is replaced with the name of the site.

Add %S.png

Translating the strings from property files is exactly the same as translating those from DTD files. For this particular example, simply refer to the steps from example one, replacing the Manage Search Engines... string with the Add %S string. Just as with the DTD file, you can periodically export an .xpi file that you can install on Firefox to see your saved, translated strings.


Exporting an .xpi language pack

Congratulations! Now that you've translated and saved some strings, let's export your translated strings for you to see your translations in your Firefox Aurora browser. The export utility in the Export tab gives you a few different options for export. Some options are meant for testing your translations, others are meant for your final approved translations that will be incorporated into the next Firefox release. For our example, we're going to concentrate on exporting your translations in an .xpi language pack.

  1. Navigate to the Export tab. The image below illustrates what you'll see once you're there.


  1. Select the Approved suggestion option from the Export translations using: drop down menu.
  2. Check the Clean export directory before exporting check box.
  3. Click on the Export button.
  4. Once the status bar is complete, you will see .zip, .html, and .xpi hyperlinks appear. Click on the .xpi link to save it to your disk.

An .xpi language pack is built every time you export your translation. All untranslated strings are exported with en-US strings as part of your language pack. This allows you to test your work-in-progress as you go so you can see your work!

When exporting files, the Mozilla source code structure is preserved. At any point during your translation efforts, you can export the en-US.zip package if you want to see the Firefox source code structure of the files with en-US strings. 

To learn how to test your freshly exported language pack, visit the QA page of the Localization Quick Start Guide.

Warning: Do not run hg push on an exported .xpi lang pack as this is only a testable local build and does not belong in the Mercurial repositories.

Final Export

Once you've completed your translation, tested it, and reviewed it, it will be time to produce your final export (in .zip format) for submission to Mozilla. To do this, send an email to either the dev-l10n mailing list or the Narro global admin asking for assistance.

Please note that the Mozilla l10n-drivers have produced the l10n dashboard to track the release progress for all Mozilla localizations. The dashboard is based on a powerful tool called Compare-Locales. Should you choose to use Narro for your localization, be aware that Narro invalidates this dashboard's project tracking accuracy because of the way that Narro manages its strings and exports.


Document Tags and Contributors

Contributors to this page: teoli, jbeatty, Minh Nguyen, khartahk, sethb@mozilla.com
Last updated by: teoli,