|
|
| Line 23: |
Line 23: |
| By altering the DTD file, you change the text displayed within the application. | | By altering the DTD file, you change the text displayed within the application. |
|
| |
|
| = How to begin a localization =
| | You can find more information on how to [[mdc:Create_a_new_localization]] on MDC, along with [[mdc:Category:Localization|other documentation]]. |
| The following steps should give you an idea of how to localize Firefox, Thunderbird etc.
| |
| <p class="note">if you want to contribute your localizations back to the MLP, head over to the [http://www.mozilla.org/projects/l10n/registration.html registration page]. From there, you can check whether anyone is already producing localizations for your intended language, and either join them or register yourself for one of the projects.</p>
| |
| | |
| *Download a release of the product you want to localize.
| |
| **[http://www.mozilla.org/releases/ Application Suite]
| |
| **[http://www.mozilla.org/projects/firefox/ Firefox browser]
| |
| **[http://www.mozilla.org/projects/camino/ Camino Mac browser]
| |
| **[http://www.mozilla.org/projects/thunderbird/ Thunderbird mail client]
| |
| **[http://www.mozilla.org/projects/calendar/ Sunbird & Calendar]
| |
| *Extract the files, using the appropriate extraction tool:
| |
| **<tt>tar -xzvf</tt> for Linux packages
| |
| **[http://moztw.org/tools/ mozip] for the Application Suite and Sunbird
| |
| **[http://www.7-zip.org/ 7z] for Firefox and Thunderbird
| |
| **??? for Camino
| |
| **any ZIP archiver for Calendar
| |
| *Alternatively (for Firefox, and soon, Thunderbird) you can [[L10n:Localizing_Using_CVS|use CVS to download the localizable parts]], for either a branch or the current trunk.
| |
| | |
| =Localize the files=
| |
| To do this, you can use all-in-one tools or your favourite UTF-8–aware text-editor. See [[L10n:Tools|Tools]] for more information.
| |
| | |
| Ensure you translate the directory structure (from <tt>../en-US/..</tt> to <tt>../ab-CD/..</tt>) as well.
| |
| ==Package your localization==
| |
| This step applies to all localisations that aren't held in CVS.
| |
| | |
| See [http://www.mozilla.org/projects/l10n/mlp_packaging.html Packaging your Work] – however, note that when ZIPping your files, you should use '''no compression at all''':
| |
| <pre class="code">zip -r0 ''<file.jar> <dir>''</pre>
| |
| | |
| (Note, however, the directory structure used as an example in this document is obsolete.)
| |
| | |
| ==Re-package the new installer==
| |
| This step applies to all localisations that aren't held in CVS.
| |
| | |
| The basic plan of action is to take the original (en-US) installer and replace its en-US parts with your newly-localised ab-CD parts. However, you must '''also''' tell the installer to use these ab-CD parts, not the en-US ones. Additionally, you should localise the installer itself.
| |
| | |
| <p>All the installers use <tt>config.ini</tt> and <tt>install.ini</tt>. [http://www.tyndall.org.uk/create-installer.html Building a Mozilla Suite Localised Installer] gives an account of the process involved in updating these two files when creating a new installer. It is based on using <tt>mozip</tt>, but is applicable to all installers that use <tt>config.ini/install.ini</tt>.</p>
| |
| | |
| <p class="note"> when testing a 7z-based installer, use a faster compression ratio rather than one geared for smaller installer files. Only when you have checked that the installer works correctly should you recompress for minimum size.</p>
| |
| | |
| For the smallest possible installer, ensure that none of the archive files within the installer (eg XPI files) are compressed; then use the following command:
| |
| <pre class="code">7z a -t7z stage\app.7z *.* -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3</pre>
| |
| This assumes that you are in the directory with all the necessary files, and the archive will be put in a sub-directory called <tt>stage/</tt>.
| |
| | |
| ...(tbc)
| |
| | |
| = Links =
| |
| * [http://www.mozilla.org/projects/l10n/ Localization Project home]
| |
| * [http://www.mozilla.org/projects/l10n/mlp_docs.html Localization docs]
| |
| * [http://www.mozilla.org/projects/l10n/mlp_packaging.html Packaging your Work]
| |
| * [http://www.tyndall.org.uk/create-installer.html Building a Mozilla Suite Localised Installer]
| |
| * [[L10n:Home_Page|Wiki Localization Home Page]]
| |
| * [[L10n:Localizing_Using_CVS|Using CVS to download the localizable parts]]
| |
| | |
| * [news://news.mozilla.org/netscape.public.mozilla.l10n Newsgroup discussion]
| |
| * [mailto:mozilla-l10n-request@mozilla.org?subject=subscribe Mailing list]
| |
| * [mailto:mlp-staff@mozilla.org Mozilla Localization Project Staff]
| |
|
| |
|
| [[category:L10n]] | | [[category:L10n]] |
Breadcrumb: Main Page :: L10n:Home Page :: L10n:Localizing Overview
Overview
The object of localization is to translate an application's menus, dialogue boxes, labels and other settings (font, character encodings, dictionaries, default search engine etc) for a particular locale.
The Basics of Localization
The user interfaces (UIs) of Firefox, Thunderbird, the Mozilla Application Suite and Sunbird/Calendar are constructed using XML User Interface Language (XUL).
This is an eXtensible Markup Language (XML) dialect and it allows the form (layout), function, content (language) and appearance (theme) of the UI to be described in separate files.
Such separation allows applications built with XUL to be localized relatively easily.
All the text of the UI is held in DTD and Java-style .properties files. These text files link a token used in a XUL file to the actual string to be displayed. So, for example, the following XUL fragment is from am-main.xul:
<caption label="&<b class="token">identityTitle.label</b>;"/>
<description>&<b class="token">identityDesc.label</b>;</description>
and corresponds to the following fragment from am-main.dtd:
<!ENTITY <b class="token">identityTitle.label</b> "Identity">
<!ENTITY <b class="token">identityDesc.label</b> "Each account has an identity, which is the ↵
↳ information that other people see when they read your messages.">
where the "↵ ↳" indicates a single line, broken here for readability.
By altering the DTD file, you change the text displayed within the application.
You can find more information on how to mdc:Create_a_new_localization on MDC, along with other documentation.