Localization (L10N) of Trac
Trac uses Babel for localization. Trac trunk now contains the i18n framework and L10N files.
The preference panel for language works now (since r6732).
If you're only interested in using a localized version of Trac, then refer to the simpler 0.12/TracInstall instructions. The more complete installation instructions below are aimed at developers and translators.
Note: what developers and translators are respectively supposed to do is still being discussed - the following instructions describe what I've been doing for contributing to the french translations -- cboos.
Installation
Getting the Tool Chain
- Install Babel, trunk version Babel:r364 precisely for now.
Read the detailed installation instructions for Babel. Chances are that once Babel 1.0 has been release, this will be the required version for Trac and the installation will be a simple easy_install by then. For now, please don't do that and use the version explicitly specified above. - Likewise, install Genshi >= 0.5 (or trunk version >= r851).
- Get a svn checkout from the Trac trunk, e.g. svn checkout http://svn.edgewall.org/repos/trac/trunk trac-0.12dev
Translation Workflow
- Run python setup.py extract_messages.
This will generate the catalog template file: trac/locale/messages.pot. You won't need to edit that file manually. - Run python setup.py update_catalog.
This will regenerate the various string catalogs (trac/locale/*_*/LC_MESSAGES/messages.po), preserving the previously translated strings.
Usually, you will be interested in just one locale, so you can provide the -l option to specify which catalog should be updated. For example:
python setup.py update_catalog -l nl_NL.
- Now, open your favorite editor and add or modifiy translations for the extracted strings in the catalog for your language. See examples below.
- Once you're done, you should test your translations:
- Run python setup.py update_catalog -l again, for normalizing the manual edits. For example:
python setup.py update_catalog -l nl_NL.
This step is also quite useful to spot the possible mistakes, like accidental change of msgid strings. Look for lines beginning with #~, they are indicative of such errors. - Run python setup.py compile_catalog -f.
This will generate one compiled catalog (message.mo file) for each (or each specified) source catalog. You don't need to do anything with those files, they'll get installed automatically.
You will most probably need to use the force option (-f) in order to compile catalogs marked "fuzzy".
You can also use the -l option here to specify which specific locale has to be compiled. - Run python setup.py install for installing Trac and locale data, or you can use python setup.py develop once for all, if you want to be able to run Trac from your working copy.
- Run python setup.py update_catalog -l again, for normalizing the manual edits. For example:
Contributing
The various catalog files (messages.po) can be found in the repository under source:trunk/trac/locale. The messages.pot is the template file from which the various locale-specific files get created. If you need to create a catalog for a new locale (e.g. fr_CA), do:
$ ./setup.py init_catalog -l fr_CA
TODO: add translation examples
Translation status
Repository version: r7143.
| Language | Translated | Untranslated | Fuzzy | Obsolete |
| cs_CZ | 459 | 238 | 84 | 0 |
| cy_GB | 90 | 607 | 13 | 0 |
| de_DE | 678 | 19 | 1 | 0 |
| el_GR | 1 | 696 | 1 | 0 |
| en_US | 0 | 697 | 0 | 0 |
| es_AR | 668 | 29 | 47 | 0 |
| es_ES | 272 | 425 | 43 | 0 |
| et_EE | ||||
| fa_IR | 666 | 31 | 54 | 0 |
| fi_FI | 0 | 697 | 0 | 0 |
| fr_FR | 689 | 17 | 69 | 0 |
| hu_HU | 50 | 647 | 12 | 0 |
| it_IT | 697 | 0 | 0 | 0 |
| ja_JP | 594 | 103 | 2 | 0 |
| ko_KR | 659 | 47 | 0 | 0 |
| lv_LV | 16 | 681 | 3 | 0 |
| nb_NO | 191 | 506 | 0 | 0 |
| nl_NL | 232 | 464 | 41 | 0 |
| pl_PL | 36 | 661 | 34 | 0 |
| pt_BR | 475 | 222 | 18 | 0 |
| pt_PT | 349 | 348 | 3 | 0 |
| ru_RU | 543 | 154 | 127 | 0 |
| sv_SE | 148 | 549 | 50 | 0 |
| th_TH | 3 | 694 | 0 | 0 |
| tr_TR | 40 | 657 | 12 | 0 |
| vi_VN | 20 | 677 | 18 | 0 |
| zh_CN | 697 | 0 | 3 | 0 |
| zh_TW | 41 | 656 | 13 | 0 |
Translation coordination
For the various languages there are already various tickets logged in which the work on them is tracked:
- #5469
- Translation of Trac to Spanish/Español [es_ES]
- #5470
- Translation of Trac to Portuguese/Português [pt_PT]
- #5471
- Translation of Trac to Japanese/日本語 [ja_JP]
- #5472
- Translation of Trac to Chinese/中文 [zh_CN]
- #5473
- Translation of Trac to Dutch/Nederlands [nl_NL]
- #5474
- Translation of Trac to French/Français [fr_FR]
- #5475
- Translation of Trac to German/Deutsch [de_DE]
- #5476
- Translation of Trac to Portuguese/Português [pt_BR]
- #5477
- Translation of Trac to Korean/한국어 [ko_KR]
- #5478
- Translation of Trac to Russian/Русский [ru_RU]
- #5479
- Translation of Trac to Latvian/Latviešu [lv_LV]
- #5480
- Translation of Trac to Polish/Polski [pl_PL]
- #5481
- Translation of Trac to Greek/Ελληνικά [el_GR]
- #5482
- Translation of Trac to Traditional Chinese/正體中文 [zh_TW]
- #5486
- Translation of Trac to Hungarian/Magyar [hu_HU]
- #5487
- Translation of Trac to Swedish/Svenska [sv_SE]
- #5488
- Translation of Trac to Turkish/Türkçe [tr_TR]
- #5489
- Translation of Trac to Italian/Italiano [it_IT]
- #5592
- Translation of Trac to Czech/Česky [cs_CZ]
- #6382
- Translation of Trac to Farsi/پارسی [fa_IR]
- #6385
- Translation of Trac to Welsh/Cymraeg [cy_GB]
- #6430
- Translation of Trac to Thai/ไทย [th_TH]
- #6629
- Translation of Trac to Vietnamese/Tiếng Việt [vi_VN]
- #7177
- Translation of Trac to Norwegian/bokmål [nb_NO]
- #7178
- Translation of Trac to Finnish/suomi [fi_FI]
- #7186
- Translation of Trac to Argentinian Spanish/español de Argentina [es_AR]
- #7417
- Translation of Trac to English [en_GB]
- #7487
- Translation of Trac into Slovene/Slovensko [sl_SI]
- #7578
- Translation of Trac to Estonian/eesti [et_EE]
This is a way by which translators for the same language can coordinate their work.
Terms (Definitions)
Consistent and careful translation of terms like timeline, ticket, report is very important. These terms are used everywhere and must be easy to remember and comfortable to use.
The way to make up good translations of important terms is to discuss them before using everywhere. The easiest way to accomplish it is to set up wiki pages for different languages.
Look also at the various term definition pages:
- TracTermsCZ
- TracTermsCy
- TracTermsCz
- TracTermsDe
- TracTermsEl
- TracTermsEs
- TracTermsFa
- TracTermsFr
- TracTermsGe
- TracTermsHu
- TracTermsIt
- TracTermsJa
- TracTermsKo
- TracTermsLv
- TracTermsNl
- TracTermsPl
- TracTermsPt
- TracTermsPtBr
- TracTermsRu
- TracTermsSv
- TracTermsZhCn
- TracTermsZhTw
Open issues
- i18n infrastructure for Trac plugins
- translation of wiki pages (#1513) and help pages (TracDev/Proposals/NewHelp)
- translation of text within Javascript source code
The following is historical information
Wiki
- We need an easy way to translate wiki pages. It should help and encourage people to translate a particular page into their native language.
- It should be possible to quickly switch between different versions of the same page. May be we should give the possibility to compare different versions on one page.
- We have to give the way to set the prefered language.
- There should be a way to quickly check if the translation is current with respect to the original version. The original version may not always be in english, so there should be a way to know which one is the original.
Interface
For the project to be localized, the actual interface would have to be translated as well. How difficult would it be to translate the interface to say, Japanese?
If possible it should be a user preference, which may require some additional changes. Ideally a single Trac site should be able to serve users in many countries. The interface should be translated and there should be support for translation of custom fields and plug-in's as well as wiki pages.
If possible it may be best if one could come up with an array of the most important terms derived from the wiki pages described below to be used in auto translating the interface.
Other Implementations
How does other software (especially wiki-software) deal with the problem of L10N? This section is devoted to describing and linking existing solutions.
Wikipedia
The famous Wikipedia has a huge collection of translations. How do they do it?
Drupal
The Drupal CMS http://www.drupal.org has a nice translation unit for its backend. It uses .po-files that can be edit and translated with the poedit http://www.poedit.net/ software.
Zope
Zope also uses gettext-catalogs for translation. All basic functionality is provided by the packages zope.i18n (language-negotiation, formats for time, date, translation of msgids with languagefallback) and zope.i18nmessageid. It also has code to use LDML-files (Locale Data Markup Language).
The template-language provides some special attibutes (e.g. i18n:domain, i18n:translate). Translation in python-code works like this (from http://svn.zope.org/Zope3/trunk/src/zope/i18nmessageid/messages.txt?rev=65911&view=log)
In this example, we create a message factory and assign it to _. By
convention, we use _ as the name of our factory to be compatible with
translatable string extraction tools such as xgettext. We then call _
with a string that needs to be translatable:
>>> from zope.i18nmessageid import MessageFactory, Message
>>> _ = MessageFactory("futurama")
>>> robot = _(u"robot-message", u"${name} is a robot.")
robot looks like a unicode-string and will be translated depending on the negotiated language and the available message-catalogs.
Attachments
-
trac-0.9.1-templates-pt-br.tar.gz
(20.6 kB) - added by fabio.david.batista@…
3 years ago.
Brazilian Portuguese Translation of the Trac templates.
-
TarSloTrans.tgz
(140.8 kB) - added by ziga
3 years ago.
Slovenian translations, not yet perfect :), of templates and source files
-
zh_cn.zip
(244.9 kB) - added by xleasun@…
3 years ago.
Just a little work for translate Trac to Chinese.
-
tracita.htm
(5.7 kB) - added by sammyrulez.at.gmail.com
3 years ago.
Italian localization
-
trac-0.9.0-20051108-gettext_support.patch
(83.0 kB) - added by sto@…
3 years ago.
Patch to add gettext support for the python code
-
trac-0.9.0-20051108-l10n.py.patch
(1.7 kB) - added by sto@…
3 years ago.
Patch that creates the trac/l10n.py file missing from trac-0.9.0-20051108-gettext_support.patch
-
trac-0.10.4_cn.zip
(103.7 kB) - added by wisyou@…
13 months ago.
0.10.4 simple chinese
-
trac-0.10.4-templates-es-ar.tgz
(28.8 kB) - added by osiux@…
12 months ago.
Argentina Spanish Translation of the Trac templates


