The Mozilla
Organization
At A Glance
Feedback
Get Involved
Newsgroups
License Terms
Newsbot
Developer Docs
Roadmap
Projects
Ports
Module Owners
Hacking
Get the Source
Build It
Testing
Download
Bugzilla
Bug Writing
Tools
View Source
Tree Status
New Checkins
Submit A Bug
FAQ
Search
">
Add this site to My Netscape!

Localizing Mozilla

by Tao Cheng<tao@netscape.com>
 Mozilla Localization newsgroup


Document History

Goal

The purpose of this documentation is to give a brief introduction of how to localize the Mozilla browser client so that the reader does not need to go through a lengthy document just to localize Mozilla into their favorite languages.
 

Short term goal: Mozilla M14 (tree close: Feb 15, 2000; on the wire: Feb. 18, 2000)

Utilize the contributed localization tools to localize the Mozilla client M14 build into all the sixteen registered languages.

As of now, we are at the end of M13 milestone development phase. In a few days, M13 will be on wire for public consumption. Since this is the first public release after Mozilla Alpha Release, lots features and improvement have been checked in. It is safer to expect that the milestone release after M13 be more stable and robust. Therefore, I'd like to invite you to localize the M14 and ship all languages in the same time frame as the English build. In other words, let's ship all our language packs within 15 days, after the US build ships. Although, nothing could prevent us from even shipping language packs simultaneously with the US build!

How to localize

The following sections outline how to localize the Mozilla client:

  1. Registering as MLP contributor(s).
  2. Download a build.
  3. Use Localization/Leveraging tool and glossary files.
  4. Work on the files.
  5. QA your work.
  6. Packaging them.
  7. Submitting.

Registering as a MLP contributor

Just send a message to the newsgroup and CC Tao, your name(s) will be inserted into MLP status table. Other information such as links to your website will be inserted into the table shall they are provided.

Where to Get Mozilla builds

You can download a milestone build here

    http://www.mozilla.org/projects/seamonkey/release-notes/index.html

or a nightly build here

    ftp://ftp.mozilla.org/pub/mozilla/nightly/

To synchronize with the Mozilla release schedule, contributors are encouraged to submit milestone builds which most people use. In the future, we plan to push localized builds and/or language packs to Mozilla's ftp sites and provide links from the Mozilla milestone build download page.

Use a Localization/Leveraging tool

Use localization/leveraging tools to improve our productivity. It'd be a waste of time and error prone if we need to localize each build from scratch. With the MozillaTranslator or MozExpTool, you can identify which strings are new and need to be localized.

Glossary Files (contributed by Daniel McGowan)

Here are a list of glossary files from previous releases (including Communicator 4.x) for reference. Translation consistency and quality can be greatly improved if there are glossary files for reference.

These files are all tab delineated text files. They can be imported into and sorted/ordered in  Excel or StarCalc (part of StarOffice - available in en, de, fr, it, es, nl, bp and sv).
 
Language Native Encoding Glossary in Native Encoding (lang-usgloss4x.txt) Glossary in UTF-8 (lang-usgloss4.x.utf8
ISO-8859-1 bp-usgloss4.51.txt bp-usgloss4.51.utf8
Czech Windows-1250  cz-usgloss4.51.txt cz-usgloss4.51.utf8
Danish ISO-8859-1  da-usgloss4.51.txt da-usgloss4.51.utf8
German ISO-8859-1  de-usgloss47.txt de-usgloss47.utf8
Greek Windows-1253 el-usgloss4.51.txt el-usgloss4.51.utf8
Spanish ISO-8859-1  es-usgloss4.51.txt es-usgloss4.51.utf8
Finnish ISO-8859-1  fi-usgloss4.51.txt fi-usgloss4.51.utf8
French ISO-8859-1  fr-usgloss47.txt fr-usgloss47.utf8
Japanese Shift_JIS  gloss-ja.txt n/a
Hungarian Windows-1250  hu-usgloss4.51.txt hu-usgloss4.51.utf8
Iberian Portuguese ISO-8859-1  ib-pt-usgloss4.06.txt ib-pt-usgloss4.06.utf8
Italian ISO-8859-1  it-usgloss4.51.txt it-usgloss4.51.utf8
Dutch ISO-8859-1  nl-usgloss47.txt nl-usgloss47.utf8
Norwegian ISO-8859-1  no-usgloss4.51.txt no-usgloss4.51.utf8
Polish Windows-1250  pl-usgloss4.51.txt pl-usgloss4.51.utf8
Slovenian Windows-1250  sl-usgloss4.51.txt sl-usgloss4.51.utf8
Swedish ISO-8859-1  sv-usgloss4.51.txt sv-usgloss4.51.utf8
Chinese (Simplied) GB2312  zh-CN-usgloss4.51.txt n/a
Chinese (Traditional) Big5 zh-TW-usgloss4.51.txt n/a
 

What needs to be localized

In Mozilla, all UI resources are located in the "chrome/" directory of the install directory. Localizable files are placed under "packageType/locale/locale_name" directories where "packageType" is one of the UI components such as the "addressbook", "bookmarks", "navigator", etc...  and "locale_name" is the language into which Mozilla is localized.

There are three types of files that need to be localized in Mozilla:

  1. The DTD (*.dtd) files. This document explains our strategy of localizing XUL files. A typical DTD file contains a list of entities that need to be localized. An entity declaration looks like this:
    1. <!ENTITY browserCmd.label "New Browser Window">
    The entity with name/key, "browserCmd.label", has the entity value, "New Browser Window". The entity value is what needs to be localized. Note the entity name, "browserCmd.label", is self-explanatory: it's the label string of the "browserCmd" menu item. The XUL writers or Localization engineers also try to include as many comments as possible in the DTD files. Such comments are placed right above the entity declaration and are marked as
     
      <!-- LOCALIZATION NOTE  entity_name: comments -->

    For example,
     
       8<!-- LOCALIZATION NOTE  throbber.url: Do NOT localize all the URL -->
       9<!ENTITY throbber.url "http://www.mozilla.org">

    Note that, UTF-8 is the default document encoding for XUL/RDF/XML files in Mozilla. Translated strings shall be in UTF-8 encoding unless otherwise indicated in the text declaration section. Native encodings such as EUC, SJIS, and others can be converted into UTF-8 by a utility program, nsconv(.exe) shipped with the client in the same directory as apprunner(.exe). The usage:
     
      nsconv -f source_encoding -t target_necoding source_file target_file

  2. The Property (*.properties) files. Property files are used as the data storage for the String Resources bundle mechanism. String resources in property files appear in the form of

  3.  
      name=value

    The "value" part is what needs to be localized. Localization notes are also added where necessary. For example,
     
       25 #-----------------------------------------------------------
       26 #   LOCALIZATION NOTE  InstallFile:...
       27 #-----------------------------------------------------------
       28 InstallFile=Installing: %s
       29 ReplaceFile=Replacing: %s

    Please note that "escape-unicode" is the only accepted document encoding in property files. You can use your favorite encoding during translation and convert it to escape-unicode via the "native2ascii" utility program available on most Unix systems. Java SDK also includes "native2ascii". In addition, nsconv(.exe) mentioned earlier can be used to convert native encoding to escape unicode. For escaped-unicode, use the name "x-u-escaped".

  4. If you're a purist and would like to see the localized client exhibit platform specific characteristics, there are two platform specific files:

      chrome/global/locale/en-US/platformGlobalOverlay.dtd
      chrome/global/locale/en-US/platformDialogOverlay.dtd

    They contain command/menuitem labels and key bindings that are considered platform dependent:

      ::::::::::::::
      platformDialogOverlay.dtd
      ::::::::::::::
      <!-- unix -->
      <!-- OK Cancel Buttons -->
      <!ENTITY okButton.label "OK">
      <!ENTITY cancelButton.label "Cancel">
      ::::::::::::::
      platformGlobalOverlay.dtd
      ::::::::::::::
      <!-- unix -->
      <!-- LOCALIZATION NOTE : FILE Do not translate all the Cmd.key and accesskey -->
      <!ENTITY closeCmd.label "Close">
      <!ENTITY closeCmd.key "W">
      <!ENTITY closeCmd.accesskey "c">
      <!ENTITY quitApplicationCmd.label "Quit">
      <!ENTITY quitApplicationCmd.key "Q">
      <!ENTITY quitApplicationCmd.accesskey "q">
      <!ENTITY redoCmd.label "Redo">
      <!ENTITY redoCmd.key "Z">
      <!ENTITY redoCmd.accesskey "r">

    Customizing them on per platform basis makes the product more user-friendly.
  5. The chrome registry, "chrome/registry.rdf". Localized files for a package type shall be placed under the associated "locale_name" subdirectory. In order for the Mozilla client to pick up the localized files, the name entries (in-between <name>...</name>) in the chrome registry must be replaced with the "locale_name". (10/29/99)
  6. Please note that the registry file and the implementation of the Configurable Chrome has been re-architectured. The new way of configurating the chrome registry follows.

       

      Please create a "chrome.rdf" file with such content:

        <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
               xmlns="http://chrome.mozilla.org/rdf#">
            <RDF:Description about="chrome://addressbook/locale/">
              <name>en-US</name>
            </RDF:Description>
        </RDF:RDF>

      Replace the "addressbook' part with the package name, such as global, navigator, etc..., and the "en-US" part with the locale name (where you put the translated files). And then, drop it into chrome/[package]/locale. You need one chrome for each package.  If you are using MozillaTranslator v.2, the "chrome.rdf" are created automatically. This shall work on builds after 2000-01-28.

QA the localization results

This is to have the language pack reviewed and tested so that bugs or flows can be identified beforehand and thus avoid respinning of the localized builds. Ideally, the QA shall not be the author since the author tends to go through paths that she/he is familiar with.

Packaging

There are couple of ways of packaging the localization results

  1. As an individual language pack. In other word, pack all files in chrome/[package]/locale/[locale-name] directories. This will result in a minimum size of deliverable that can be downloaded and installed in the end user's isntall directory. Before the re-architecturing of the Configurable Chrome feature is settled, please leave localized files in the en-US directories.
  2. As a complete localized build in a big zip (or gz)  file. All the end users need to do is to download and unzip the build into their local directories.
  3. A localized installer build. A complete professional quality installation process. This relies on the availability of a localizable xpinstaller. As of now, this is not feasible yet; but, it is the ultimate goal.

Submitting

After you're done, please post them to the newsgroup or send it to me. I'll push them up to Mozilla Org. for downloading. (Checking them into the source tree does not make them a language pack yet.)

We are also planning to push the localized build up to Mozilla.org's FTP site. Once we push the localized builds up to the FTP sites, I expect more people to download and use them since the FTP download sites get more visibility than the MLP's home page.

Localization/Leveraging  Tools

Localization tools contributed from the net:
 
Tool Name Contact The Package Source Directory Notes
MozExpTool
      Jordi Mas
    MozExpTool 0.94
 mozexptool source notes from the author
MozillaTranslator   Henrik Lynggaard 
  1.  MozillaTranslator v.3.1 (MozillaTranslator.jar); notes  
  2.  MozillaTranslator v.3 (MozillaTranslator.jar & run.bat); notes  
  3.  MozillaTranslator v.2 (MozillaTranslator.jar & run.bat); notes  
  4.  http://sites.netscape.net/lynggaard/
 MozillaTranslator

Notes

  • MozExpTool. A VisualC++ based project. It is designed to address the localization and leveraging need of languages in single-byte charsets. Both source code and WIN32 binary are available. More detailed technical spec can be found here,  MozExpTool 0.94.

  • MozExpTool allows you to create text files (we call them glossaries) from dtd/xul files that you can give them to translators then they do not have to mess around with dtd/xul files. When the translators have finished their translations you can reimport them into the dtd/xul files.

    A part of helping the simplifying the translator's work, MozExpTool allows to leverage (recover previous translations). You can easily create a glossary file from the old version, and then reimport it to the set of dtd/xul files. When leveraging, we take in account the context of the translation, that is, the file that is coming from and the name of the entity.
     

  • MozillaTranslator is a GUI-based Localization and Leveraging tool written in Java. Although still in development stage, it is suitable for both single-byte and double-byte charsets including all Latin-1, 2, and CJK (Chinese, Japanese, and Korean): nearly all languages covered by Unicode. The package is available as a single jar file together with a DOS batch driver. JDK.1.2.2 is needed to run the program.

MozillaTranslator

See details here.

MozExpTool 0.94

This new version has been used sucesfully to leverage the strings to build 13, and I has been used for a couple of weeks without any problem.

What's new in version 0.94?

  • Line feeds, return lines and tabs within entities definitions are handled properly. We use now the standard \n, \r, and \t to refer to them.
  • If there are comments in the DTD files they are included in the glossaries when they are exported.   This helps to the translators that work with the glossary files.
  • The parser code has been move to a class.
  • Small bug fixes.

Mozilla Localization Project (MLP)

This page explains how you can contribute your localization work to Mozilla and the current status of the Mozilla Localization Project.

The following table summarizes the current contributions of Mozilla (5.0) localization. Contact the original contributors or Tao Cheng if you have problems using these language packs.
 
Languages (locale name) -  40 Contributor(s) Localized Build or Language Packs QA Notes
Arabic  Hassan Aurag
Bosnian (bosnian-BA)  Adnan Selimovic , Isan Selimovic , Jasmin Azemovic
  1.  mozilla-win32.zip  
  2.  bosnian.zip 
  3.  Note from Adnan 
Bulgarian  Bozhan Boiadzhiev
Catalan  Jordi Mas (M14)
Chinese - Simplified (zh-CN)  Jack LeeWang JianXiaodan ZhuWeiping Liu (M14)
Chinese - Traditional (zh-TW)  Wan-Teh Chang  
Czech  Jan Pokorny
 Jiri Znamenacek
  1. Zipped beneath \bin\chrome. 
  2. Overwrite en-US directories.
  3. Please direct comments to Jan Pokorny
Danish (da-DK)  Henrik Lynggaard  The zip file.
Dutch (NL)  Jan Fabry  (M14)  Dutch translation web site
English (en-UK)  Nathan Kirkham , Alastair Moore
Esperanto   Eduardo
Estonian   Kristjan Zink
Finnish   Raine Rapo, Arto Laitinen
French   Olivier Bailly,   Jean-Claude Ben,   David Bellot,   Rither (M12)
Georgian  Gia Shervashidze
German  Robert Kaiser
Greek  Kyriakos K. Skafas (M14)
Hawaiian  Keola Donaghy (M14)  Keiki Kawai'ae'a
Hebrew  Zvi Nachmani (M14)
Hungarian  XYBeR
Indonesian  Dan Howard , Albert Sutojo, and Endro Koesno M12: Full build or language pack only (or here)  Albert Sutojo and Endro Koesno  Related link
Italian   Andrea,  Daniele Curto,  Daniele Medri,  Andrew,  Fabio,  Giovanni
Japanese  Yuta Taniguchi
, Ryoichi Furukawa
 KazuYamamoto
Japanese language pack The "en-US" pack overwrites all files under "locale/en-US", while the "ja-JP" pack places translated files under "locale/ja-JP". Related information of Japanese language pack.
Malay (ms-MY)  Ranjinath
Norwegian (Bokmål) Magnus Sulland
Norwegian (nynorsk)   Karl Ove Hufthammer
  • (M14)
  •  M13  
See details here:  http://home.no.net/huftis/mozilla.html
Plautdietsch (Mennonite Low German)   Chris Cox
Polish  Marcin Jagodzinski (done; except Editor, Preferences, acceptkey) Related documents.
Portuguese (pt-BR; Brazil)  Andrei Bosco
 , Marcos Paulo Hauer, Hebert Silva, Ricardo LoiolaRicardo Guimarães
Portuguese (pt-PT; Portugal) Francisco Castanheiro  & Pedro Figueira (M14)  Portuguese Mozilla homepage
Romanian  Vlad Gavrila
Russian  Dmitry Sivachenko,
  Pedro Rosa, Aleksey Titorenko (Software Project Department of Stack Ltd) 
Serbian  Zeljko Cvrkotic
Spanish (es-CO)  Silvio Andrés Salazar Martínez
Spanish (es-ES)  Alexander Kadlec Aguirre (NAVE project)
Swedish (sv-SE)  Fredrik (M14)
Thai  Isiya Paireepairit Partial translations for Navigator windows only.
Turkish  Huseyin Killic
Ukrainian (uk-UA)   Sergey 
Welsh  Kevin Donnelly

Notes

  1. The language packs are portable across platforms.
  2. mozilla-win32.zip  contains the Mozilla executable, English language files, and Bosnian language files. By default, the UI language is in Bosnian.
  3.   bosnian.zip contains only the language files needed for Bosnian. You need to unzip them into chrome/ directory and change all "en-US" name entries to "da-DK" in chrome/registry.rdf to pick up these UI strings.
  4.  Used only ASCII characters in bosnian-BA DTD files, because by the time of M8.5 some windows crashed when special UNICODE characters were used. I wanted that Mozilla runs as good as possible, so I converted all our special characters into ASCII ones. This method is used allot here. To display our characters people must have PANEURO version of Windows 9x or NT. Our software is mostly without this special characters. Plan to change this for the next release.
  5.  This zip file contains only the language files needed for Danish. You need to unzip them into chrome/ directory and change all "en-US" name entries to "da-DK" in chrome/registry.rdf to pick up these UI strings.

Getting Access Privilege to the tree

Localization contributors and translators will need CVS access privilege to check in localization work into Mozilla. Here is the link to the page that describes the tree rules and how to obtain a CVS account .
 http://www.mozilla.org/hacking/
To accommodate localization related files but avoid breaking the build process of other modules, there will be a dedicated directory, "l10n/", created under the top directory of the Mozilla tree, "mozilla/". See next section for details.
 

The Directory structure for Localization related work

The following tree structure is proposed to accommodate all localization related work in the Mozilla tree.

  1. The directory structure. Share the CVS repository with the Mozilla tree but place localization related files under separate directory. Tague Griffith recently created a new directory, "l10n/" to accommodate the open source L10n tools contributed from the net. The tools will be checked in under a subdirectory, "l10n/tools/". We can have the language specific files placed under a subdirectory, "l10n/lang/", in parallel with the tools. And then there is another sub-directory, "l10n/builds", which accommodates various build related files. The directory structure looks like this:
  2. mozilla/

      [other modules]
      [...]
      l10n/
        tools/
          mozexptool/
          mozillatranslator/
          etc...
        lang/
          addressbook/locale/
                bosnian-BA/
                da-DK/
                da-DK-vendor1
                ja-JP-vendor1
                ja-JP-vendor2
                etc...
          bookmarks/locale/
                bosnian-BA/
                da-DK/
                da-DK-vendor1/
                ja-JP-vendor1
                ja-JP-vendor2
                etc...
          [other package types, etc...]
        builds/
          [release team's stuff]

  3. Pulling the tree. The current Mozilla build process does not pull "l10n/". Therefore, other module developers will not pull "l10n/" unless they explicitly do so. This addresses the concern about tree pulling time and wasted disk space problems. However, during the development cycle, we still have the choice of making the pulling of l10n/ be the default.

  4.  

  5. The build script. The build script of the localized client can be setup to be part of the daily build or run as a standalone script.
The advantages of this approach follow.

  • Since l10n is not part of the daily Mozilla build pull, localization checkins (under "mozilla/l10n") are not restricted by the Tinderbox rules and therefore are not on the hook.

  •  

  • Net developers can be granted access privilege and work on the open source tree directly.
Note that this by no means encourages people to abuse the "mozilla/l10n" directory. All CVS checkin rules still apply. Courtesy to peer contributors and respect for module ownership is required in the open source community.
 

References and more information...

FAQ of MLP

  • Mozilla Open Source client v.s. Netscape branded client
    • There will be planned beta releases (and the final RTM) of Netscape branded builds. Netscape might choose to localize some or all of them into languages such as German,French, Japanese, etc... See Q/A sessions below for more information.

  • What license statement, ULP, NPL, or MPL , shall be inserted into the translated resource files such *.dtd and *.properties?
  • To licence your work under the MPL you should include a boilerplate licence in a comment at the beginning of each file.

    New files checked into the tree need to have licensing text added to the top. Here is table containing versions of this boilerplate text preformatted for various different types of files.
     

    Please always use these templates when adding files to the tree: they are carefully formatted so that future updates to the boilerplate will be easy to make.

  • Sample MPL as follows.
    "The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

    Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

    The Original Code is Mozilla Communicator client code, released March 31, 1998.

    The Initial Developer of the Original Code is Netscape Communications Corporation. Portions created by Netscape are Copyright (C) 1998-2000 Netscape Communications Corporation. All Rights Reserved.

    Contributor(s): ____________________________________."

       

  • Shall we localize the license?
  • No. The boilerplate text should appear as-is, in English. However I think that a localized comment following the boilerplate that points to a translation would be fine provided that  the following disclaimer is provided with the translation.

    In places where the NPL, MPL or boilerplate are translated, please place a translation of the following language at the beginning of  the translated license:

    "The controlling language of this agreement is English. The following [lang] language translation has been provided for your convenience only."

    Substitute your language for "[lang]".
     

  • Can contributors distribute the localized version?
    • Yes, as long as you comply with the MPL, there shall be no problem.

  • Into what languages will the Netscape branded version be localized?
    •  
    Netscape branded version will be localized at least into German, French and Japanese. Future plans for other languages will be announced at Netscape's discretion.
       

  • Is Netscape going to release localization work in Netscape branded version to the open source tree, Mozilla? How about OEMs'?
    •  
    Netscape localized files will be posted into mozilla in the languages that we localize as we have them available.
       

  • Will we incorporate the contributed translations into the Netscape branded version?
    •  
    Currently, Netscape and it's partners are producing the language versions we need to support its business strategies. If those strategies change, Netscape may choose to look to the work being done on mozilla.org.
     

  • How do we deal with conflicts such as Mozilla version vs Netscape version of the same languages?
    •  
    Mozilla and Netscape branded product will be two different products; open source developers can have their localized files checked into mozilla tree without conflicting with Netscape branded product.

Document History - 1999

  • 12/23/1999: Upload Japanese translation for M12.
  • 12/20/1999: Update German referenece build info. Add Catalan and Norwegian.
  • 12/17/1999: Add Brazilian and German.
  • 12/14/1999: Add Hawaiian translation info.
  • 12/03/1999: Add Greek translation info.
  • 12/02/1999: Add Mozilla M11 based translation for Japanese. Add Polish translation information.
  • 11/10/1999: Add partial translation for Thai. Also, updated Danish pack status.
  • 10/29/1999: MLP: add Thai and Czech contacts
  • 10/18/1999: add References and more information... section.
  • 10/15/1999: Add table to summarize the current contributions. Add link to Jordi and Henrik's tools.
  • 10/01/1999: Minor corrections
  • 09/27/1999: Add FAQ section.

  • 09/23/1999: First draft.
     
Copyright © 1998-2000 The Mozilla Organization.
Last modified February 28, 2000.