|Version 19 (modified by 14 years ago) ( diff ),|
Localization (L10N) of Trac
This page is here to propose and discuss Trac changes to support localization (L10N).
First of all let's define all possible goals. Feel free to add your own. It is understood that not all of them can be necessarily implemented.
I18N is not only translation, it is also a bunch of other things. Since currency or paper size or units of measurement are not relevant here, the most important aspect besides translation is the format of time and date. Trac, unfortunately, uses the least sensible date format throughout, with the day between month and year. The date format should be configurable, and the default, as this is a technical environment should be ISO 8601, such as 2005-07-29.
- 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.
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. 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.
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. See, for example TracTermsPtBr, TracTermsEs, TracTermsFr, TracTermsKo ,TracTermsRu, TracTermsJa, TracTermsDe, TracTermsLv, TracTermsPl, TracTermsEl, TracTermsZhCn, TracTermsZhTw. Add your own using TracTermsEn as an example.
How does other software (especially wiki-software) deal with the problem of L10N? This section is devoted to describing and linking existing solutions.
The famous Wikipedia has a huge collection of translations. How do they do it?
Your Own Example
Please add your own example here.
Temporary Workaround: Template Translation
Can it be useful? I think so. trac-0.9.1-templates-pt-br.tar.gz
Temporary Workaround 2: gettext support for trac 0.9 and mod_python
Adding this patch and this other patch to trac-0.9.0 you can translate almost all the strings that are not from the templates or the database. Using the patch and a set of tranlated templates you can use the program in your language easily (the solution is suboptimal, as you can only use one language for each project, but at least it is localized).
To translate it put your self on the trac source dir and do:
xgettext -o trac.pot `find trac/ -name '*.py' `
Translate the trac.pot to your language (I usually copy it to
$LANG.po, on the example I'll use
LANG=ca) and compile the translations:
msgfmt ca.po -o /usr/share/locale/ca/LC_MESSAGES/trac.mo
I've only tested the patch with mod_python, to enable the translations on the apache config I've added the
TracLocale option after setting the
PythonHandler to the trac one:
PythonHandler trac.web.modpython_frontend PythonOption TracLocale ca_ES.UTF-8