Bugzilla:L10n:Guide: Difference between revisions
(→Terminology: First draft) |
(→Localizing Templates: First draft) |
||
| Line 80: | Line 80: | ||
and create your localized Bugzilla glossary. | and create your localized Bugzilla glossary. | ||
=== | === Localizing Templates === | ||
The template files are identified by the extension ''.tmpl''. The are generated with Template Toolkit.<br> | |||
Currently, these templates contain code and localizable strings mixed together that makes the localization of Bugzilla a bit difficult: what is to be localized and what is not?<br> | |||
<pre> | |||
IMPORTANT: Use an UTF8 compliant editor like Gedit, Kate or Emacs under GNU/Linux systems | |||
or Notepad++ under Windows systems and localize the templates using | |||
UTF8 encoding. | |||
</pre> | |||
Here are some examples to help you localizing the right stuff:<br> | |||
A good idea is to start with the localization of ''/template/en/default/global/variables.none.tmpl''. This file contains several terms that will be substituted all around the templates files. You can see in this file lines like these:<br> | |||
<pre> | |||
[%# 1.0@bugzilla.org %] | |||
[%# The contents of this file are subject to the Mozilla Public | |||
# License Version 1.1 (the "License"); you may not use this file | |||
</pre> | |||
DO NOT translate text located after the character ''#'': the text located after this character is comment. | |||
<pre> | |||
[% terms = { | |||
"bug" => "bug", | |||
"Bug" => "Bug", | |||
"abug" => "a bug", | |||
"Abug" => "A bug", | |||
"ABug" => "A Bug", | |||
"bugs" => "bugs", | |||
"Bugs" => "Bugs", | |||
"zeroSearchResults" => "Zarro Boogs found", | |||
"bit" => "bit", | |||
"bits" => "bits", | |||
"Bugzilla" => "Bugzilla" | |||
} | |||
%] | |||
</pre> | |||
DO NOT translate ''terms'' here. | |||
What is to be translated here, is the word after ''=>''.<br> | |||
For instance:<br> | |||
<pre> | |||
"Bug" => "Bogue", | |||
</pre> | |||
These terms will be used in the templates. Whenever you see expressions like ''$terms.ABug'' or ''$terms.bugs'' in templates, they will be replaced in the user interface with the value you put in this file.<br> | |||
Another file that is use by several templates is ''/template/en/default/global/field-descs.none.tmpl''. You can see there lines like these:<br> | |||
<pre> | |||
[% PROCESS global/variables.none.tmpl %] | |||
[% field_descs = { "[Bug creation]" => "[$terms.Bug creation]", | |||
"actual_time" => "Actual Hours" | |||
"alias" => "Alias", | |||
"assigned_to" => "Assignee", | |||
...... | |||
[% USE Bugzilla %] | |||
[% FOREACH bz_field = Bugzilla.get_fields() %] | |||
[% SET field_descs.${bz_field.name} = bz_field.description | |||
IF !field_descs.${bz_field.name}.defined %] | |||
[% END %] | |||
</pre> | |||
DO NOT translate here ''PROCESS'' or ''USE''. As a general rule, never translate capitalized words enclosed between ''<nowiki>[% and %]</nowiki>''.<br> | |||
As previoulsly, translate the word after the ''=>''.<br> | |||
<pre> | |||
[% PROCESS global/variables.none.tmpl %] | |||
[% field_descs = { "[Bug creation]" => "[Date de création du $terms.bug]", | |||
"actual_time" => "Heures actuelles" | |||
"alias" => "Alias", | |||
"assigned_to" => "Responsable", | |||
...... | |||
[% USE Bugzilla %] | |||
[% FOREACH bz_field = Bugzilla.get_fields() %] | |||
[% SET field_descs.${bz_field.name} = bz_field.description | |||
IF !field_descs.${bz_field.name}.defined %] | |||
[% END %] | |||
</pre> | |||
Now, you can start translating the other templates. | |||
Some other examples of what need to be translated:<br> | |||
<pre> | |||
[% title = BLOCK %]Delete Component '[% comp.name FILTER html %]' | |||
of Product '[% product.name FILTER html %]' | |||
[% END %] | |||
[% PROCESS global/header.html.tmpl | |||
title = title | |||
%] | |||
<table border="1" cellpadding="4" cellspacing="0"> | |||
<tr bgcolor="#6666FF"> | |||
<th valign="top" align="left">Field</th> | |||
<th valign="top" align="left">Value</th> | |||
</tr> | |||
</pre> | |||
Localized example:<br> | |||
<pre> | |||
[% title = BLOCK %]Suppression du composant « [% comp.name FILTER html %] » | |||
du produit « [% product.name FILTER html %] » | |||
[% END %] | |||
[% PROCESS global/header.html.tmpl | |||
title = title | |||
%] | |||
<table border="1" cellpadding="4" cellspacing="0"> | |||
<tr bgcolor="#6666FF"> | |||
<th valign="top" align="left">Champ</th> | |||
<th valign="top" align="left">Valeur</th> | |||
</tr> | |||
</pre> | |||
TBD : add other tricky examples | |||
==== Hardcoded strings ==== | ==== Hardcoded strings ==== | ||
TBD | |||
==== Caveats ==== | ==== Caveats ==== | ||
TBD | |||
<nowiki>[% %]</nowiki> and <nowiki>[%+ %]</nowiki><br> | |||
apostrophes and quotes inside apostrophes pairs and quotes pairs<br> | |||
${terms.bugs} | |||
=== Test === | === Test === | ||
Revision as of 17:07, 19 January 2008
Thus guide is under construction bug 412654. Previous version is available.
Overview
This guide provides new localizers a step by step howto to localize Bugzilla in their own locale.
It also contains useful resources links to get the contribution done and to keep the localization up-to-date.
Getting Started
You should first look if somebody else is already working on localizing Bugzilla in your locale.
This page shows all the localized Bugzilla releases we aware of. If you cannot find the version of Bugzilla you want to localize on this page, that doesn't mean that this version is not currently handled. So, please contact the current maintainer or team to avoid duplicated effort. Current active locales can be found in this section.
Once you are sure that nobody is already working on your locale or when you have coordinated with the current team/owner, you can start with the localization.
Obtaining The Source Files
Unless you are sure about the release you want to localize, we advise you to start with the latest stable version. See the Release page to see the latest version and to download the tar.gz archive.
Uncompress the tarball with your favorite tool in an empty directory.
You should have the following tree structure (note: all subdirectories and files are not detailed here):
bugzilla-X.Y.Z (where X.Y.Z are the numbers for the release) --Bugzilla --contrib --docs | --lib | --pdf | --txt | --xml | --html | --images | --images --js --skins --t --templates | --en | --default | --extensions .UPGRADING .UPGRADING-pre-2.8
The localizable contents are located under the following directories:
docs/xml
templates/en
The files UPGRADING and UPGRADING-pre-2.8 are also localizable.
You should focus first on the /templates directory, which contains all the files used to build the user interface.
First, remove all the /CVS subdirectories under the /templates directory:
- GNU/Linux
$cd templates $rm -rf `find . -name CVS`
- Windows
TBD
- Mac
TBD
Then, you should rename the /en subdirectory for your locale name.
For instance, you can use fr for French or ca for Catalan.
You can also use a four-letter locale code:
For instance, pt-BR for Brazilian Portuguese or zh-CN for Chinese (Simplified).
See page TBD for the locale code that best fit for your locale.
The task
Terminology
Before running into localizing the files, you should set up a terminology for the Bugzilla specific terms, in order to stick to it, that is to say, you will always use the same localization for a given term.
For instance, start thinking about the localization of some of these tricky terms:
- Whine/Whining
- Requestee
- Flags
- etc.
and create your localized Bugzilla glossary.
Localizing Templates
The template files are identified by the extension .tmpl. The are generated with Template Toolkit.
Currently, these templates contain code and localizable strings mixed together that makes the localization of Bugzilla a bit difficult: what is to be localized and what is not?
IMPORTANT: Use an UTF8 compliant editor like Gedit, Kate or Emacs under GNU/Linux systems or Notepad++ under Windows systems and localize the templates using UTF8 encoding.
Here are some examples to help you localizing the right stuff:
A good idea is to start with the localization of /template/en/default/global/variables.none.tmpl. This file contains several terms that will be substituted all around the templates files. You can see in this file lines like these:
[%# 1.0@bugzilla.org %] [%# The contents of this file are subject to the Mozilla Public # License Version 1.1 (the "License"); you may not use this file
DO NOT translate text located after the character #: the text located after this character is comment.
[% terms = {
"bug" => "bug",
"Bug" => "Bug",
"abug" => "a bug",
"Abug" => "A bug",
"ABug" => "A Bug",
"bugs" => "bugs",
"Bugs" => "Bugs",
"zeroSearchResults" => "Zarro Boogs found",
"bit" => "bit",
"bits" => "bits",
"Bugzilla" => "Bugzilla"
}
%]
DO NOT translate terms here.
What is to be translated here, is the word after =>.
For instance:
"Bug" => "Bogue",
These terms will be used in the templates. Whenever you see expressions like $terms.ABug or $terms.bugs in templates, they will be replaced in the user interface with the value you put in this file.
Another file that is use by several templates is /template/en/default/global/field-descs.none.tmpl. You can see there lines like these:
[% PROCESS global/variables.none.tmpl %]
[% field_descs = { "[Bug creation]" => "[$terms.Bug creation]",
"actual_time" => "Actual Hours"
"alias" => "Alias",
"assigned_to" => "Assignee",
......
[% USE Bugzilla %]
[% FOREACH bz_field = Bugzilla.get_fields() %]
[% SET field_descs.${bz_field.name} = bz_field.description
IF !field_descs.${bz_field.name}.defined %]
[% END %]
DO NOT translate here PROCESS or USE. As a general rule, never translate capitalized words enclosed between [% and %].
As previoulsly, translate the word after the =>.
[% PROCESS global/variables.none.tmpl %]
[% field_descs = { "[Bug creation]" => "[Date de création du $terms.bug]",
"actual_time" => "Heures actuelles"
"alias" => "Alias",
"assigned_to" => "Responsable",
......
[% USE Bugzilla %]
[% FOREACH bz_field = Bugzilla.get_fields() %]
[% SET field_descs.${bz_field.name} = bz_field.description
IF !field_descs.${bz_field.name}.defined %]
[% END %]
Now, you can start translating the other templates.
Some other examples of what need to be translated:
[% title = BLOCK %]Delete Component '[% comp.name FILTER html %]' of Product '[% product.name FILTER html %]' [% END %] [% PROCESS global/header.html.tmpl title = title %] <table border="1" cellpadding="4" cellspacing="0"> <tr bgcolor="#6666FF"> <th valign="top" align="left">Field</th> <th valign="top" align="left">Value</th> </tr>
Localized example:
[% title = BLOCK %]Suppression du composant « [% comp.name FILTER html %] » du produit « [% product.name FILTER html %] » [% END %] [% PROCESS global/header.html.tmpl title = title %] <table border="1" cellpadding="4" cellspacing="0"> <tr bgcolor="#6666FF"> <th valign="top" align="left">Champ</th> <th valign="top" align="left">Valeur</th> </tr>
TBD : add other tricky examples
Hardcoded strings
TBD
Caveats
TBD
[% %] and [%+ %]
apostrophes and quotes inside apostrophes pairs and quotes pairs
${terms.bugs}
Test
Release
Resources
Current active locales and maintainers
| Locale | Locale Code | Maintainer | Site | |
| العربية/Arabic | [ar] | محمد السباعي (Muhammad Alsebaeyie) | Site | |
| Беларуская/Belarusian | [be] | Сяргей (Siarhei) | Site | |
| Български език/Bulgarian | [bg] | Георги Д. Сотиров (Georgi D. Sotirov) | Site | |
| Čeština/Czech | [cs] | Norbert Volf | Site | |
| Deutsch/German | [de] | Marc Schumann | Site | |
| Français/French | [fr] | Cédric Corazza | <cedric.corazza at wanadoo.fr> | Frenchmozilla |
| Italiano/Italian | [it] | Marco Cucinato | Site | |
| 한국어/Korean | [ko] | 심우곤/WooGon Shim | Site | |
| Nederlandse/Dutch | [nl] | Hendrik Maryns | Site | |
| Polski/Polish | [pl-PL] | AviaryPL | Site | |
| Portugues (Brasil)/Brazilian Portuguese | [pt-BR] | Felipe Gaucho | Site | |
| Русский/Russian | [ru] | Vitaly Fedrushkov | Site | |
| Español (España)/Spanish (Spain) | [es-ES] | Oscar Manuel Gómez Senovilla | Site | |
| Español (México)/Spanish (Mexico) | [es-MX] | Javier Abdul Córdoba Gándara | Site | |
| Español (Paraguay)/Spanish (Paraguay) | [es-PY] | ? | Site | |
| 中文/Chinese (Simplified) | [zh-CN] | 天下 (Hou Guangmin)/蒋艳 (jiangyanfeng) | Site | |
| 繁體中文/Chinese (Traditional) | [zh-TW] | 嘉利 (SMA) | Site |
Tools
- WinMerge
- WinMerge is an Open Source visual text file differencing and merging tool for Win32 platforms. With full UTF-8 support, it is highly useful for determing what has changed between project versions, and then merging changes between versions.