Categories: Getting Started Tools

Tips & tricks: Cleaning up Narro exports

If you’ve ever used Narro to localize a project, you may have spent time cleaning up your exported files before they are committed to your locale’s repository. If you don’t catch the errors within your Narro export, you’ll find that some files may be reverted or corrupted in other ways that can ultimately break your localization. On the other hand, cleaning up these exported files can require some time and smooth hacking skills.
While these Narro bugs are being fixed, here’s a work around that you can easily use to make sure that your L10n work is squeaky clean before it goes into your locale repository.

First we’re gonna update your local, cloned repo by running the following commands from your local directory:

hg pull
hg update -C -r default

Then, select, drag, and drop the Narro export into your updated repo.

Now that you have your export in your local directory, review the file status by using this command:

hg status

Running this command will display what files in your local directory have been modified, added, and removed compared to the mercurial repository. You’ll see output like this:

M toolkit/crashreporter/crashreporter.ini
M toolkit/defines.inc
! browser/README.txt
! toolkit/chrome/mozapps/xpinstall/xpinstallConfirm.properties
? browser/branding/official/brand.dtd
? browser/branding/official/brand.properties

What does the output mean? It’s actually rather straight forward to interpret.

  • M = Modified
  • ! = Missing
  • ? = Hg doesn’t know about this file
  • A = Added to your local repo
  • R = Removed by running hg remove

You’ll use the printed status output to evaluate what areas of your local repository need to be cleaned up before committing to your hg locale repo.

Here are issues to keep your eye on within your status output:

  • Clean up files ending in .orig. These are most commonly labeled as ? in your status output and must be removed. You can find these by either running this command:
find . -name \*.orig -exec rm \{\} \;

or copying and pasting your output from the command line to your favorite text
editor and using its Find function, then removing those files by drag and drop.

  • Revert your region.properties file and search plugins (if needed) by running this command:
hg revert -C -r default browser/chrome/browser-region browser/searchplugins
  • Check for accessibility errors and & in .properties files. The problem here is that Narro exported .properties files consider the & character to denote an access key, thus Narro removes it from HTML fragments and breaks entity references, like &. You’ll have to manually make these changes in your favorite text editor.
hg diff dom/chrome/layout/htmlparser.properties browser/chrome/browser/quitDialog.properties browser/chrome/browser-region/region.properties browser/installer/custom.properties browser/installer/mui.properties browser/installer/override.properties toolkit/chrome/global/commonDialogs.properties toolkit/chrome/passwordmgr/passwordmgr.properties toolkit/chrome/search/search.properties
  • Revert the files that Narro likes to break (found in the command below). If you had actual L10n work in them, you’ll need to manually fix those files in your favorite text editor. If you don’t have L10n work in them, run the hg revert command on them:
hg revert -r default dom/chrome/layout/htmlparser.properties  browser/chrome/browser/quitDialog.properties  browser/chrome/browser-region/region.properties  browser/installer/custom.properties browser/installer/mui.properties  browser/installer/override.properties  toolkit/chrome/global/commonDialogs.properties  toolkit/chrome/passwordmgr/passwordmgr.properties  toolkit/chrome/search/search.properties

Some final notes:

  • If your last commit was already broken, hg diff will miss that Narro has dropped the & character or even misplaced it (e.g., $Brand&ShortName), thus breaking HTML and accessibility. Be diligent and detail-oriented while looking through files to correct accessibility issues.

      For example, you may see something like below and notice that it is missing its &
character in the localized string.

   CONTEXT_OPTIONS របៀបសុវត្ថិភាព $Brand&ShortName
  • Please remember that these issues are currently being investigated. If you have any problems with these, please ask for help on the #l10n IRC channel or in the m.d.l10n newsgroup. If you find additional bugs with Narro, feel free to file a bug in Bugzilla.

Additional resources:

One comment on “Tips & tricks: Cleaning up Narro exports”

Post a comment

  1. nasir uddin wrote on

    want smooth browsing

    Reply

Leave a Reply to nasir uddin

Cancel reply

Your email address will not be published. Required fields are marked *