Narro is a handy web-based translation tool that is available to localizers to translate 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 and see your translations in a local build of Firefox.
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, let's call our new locale X-testing. Since we're interested in starting a new localization and you clearly won't find it listed in the menu, perform the following steps to set up your new localization.
- Contact the Mozilla l10n drivers using the dev-l10n mailing list to ask if your localization effort already exists.
- If no volunteer effort exists, email the same dev-l10n mailing list and ask the Narro global administrator to start a new localization in Narro for your locale. In your email, please provide
- your user name
- a bribe. Baked goods are always a good bribe :-)
- After doing this, you should receive the maintenance rights (i.e., export, import, and approval permissions) for the new localization.
- 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.
NOTE: If you are joining an existing locale, feel free to skip this step. That is, unless you're interested in learning about how the import utility works. In that case, we won't stop you.
User account created; check. Locale created by global administrator; check. Activated maintenance rights for your new locale; check. 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.
- 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.
- By default you are taken to the Project Overview tab. Navigate to the Import tag to find the import utility.
- Once there, you will find these import sections:
- Texts - for importing source files (en_US)
- 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.
- For now, we're going to focus only on the Texts and Options section. In the Texts section you will see the default location of the nightly updated source files for your project. Make sure that all the checkboxes in Options are unchecked for this first import.
- 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 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 the change in your UI.
Example 1: The DTD file
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...
Here is how you can use Narro to translate the Manage Search Engines... element:
- Navigate to the Translate tab in the Firefox Aurora project.
- Enter the string "Manage Search Engines..." in the Search for field and click Search.
After entering the string and clicking on "search", Narro presents the string you searched for.
- 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.
- Enter in the 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 the save icon. These are matches from previous translations and other translations that members of your community may have provided. The green and red boxes to the right allow you to approve or remove a translation for the active entry. Approved translations are entered into the translation memory. We do not recommend approving translations until they are in their final state. For the purposes of our example, saving your string by clicking on the save icon is enough.
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
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 is replaced with the name of the site.
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.
After you have done some work and you are ready for testing, navigate to the "Manage" link and click on it. Scroll down to the section "Export project". Make sure to leave "Copy unhandled files" as checked. This tells Narro to leave alone all the files that are not handled by the translation interface (like .txt, .rdf, .xml files) and copies them directly to your structure. Leave "Export archive format" as zip. When exporting files as a zip file, the same source structure as Mozilla code is preserved. Also, keep "Export translations using:" set at "Approved Suggestion". Click "Export" and, once the status bar is complete, you will see a .zip hyperlink appear that will allow you to save the file locally to your disk.
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. However, do not "Hg Push" from an export. This is only a testable local build.
Testing Your Locale
In order to test, you need to be able to change the locale of your browser to see your work. Install either the Locale Switcher or the Quick Locale Switcher add-on. This will allow you to shift between the present UI of your Firefox browser and the testable .xpi export from Narro. This is a requirement for locale testing with Narro. Be sure to change to the testable language by reading just how to do so from the instructions of the add-on.
Every time you export the translation, an .xpi is built. At export, any untranslated strings will get exported with en-US strings instead. This allows you to test your work-in-progress as you go so you can see your work! Visit Projects page and you will see an .xpi you can install for the latest nightly branch. To install this .xpi, click on the link and Firefox will prompt you to install the newly created .xpi (aka an "add-on" or "language pack"). You will need to restart your browser to install the .xpi.
When finished, you will need to send an email to dev-l10n mailing list or to the Narro admin asking for assistance on the export from Narro in order to participate in the Mozilla release. Please note that the Mozilla l10n-drivers have produced the "l10n dashboard" based on a powerful tool called "Compare-Locales". Because of the way that Narro manages its strings and exports, it invalidates the accuracy of the compare-locales output.