Edgewall Software

Changes between Version 16 and Version 17 of TracL10N


Ignore:
Timestamp:
Nov 9, 2005, 11:26:48 AM (18 years ago)
Author:
sto@…
Comment:

Note about gettext support patch

Legend:

Unmodified
Added
Removed
Modified
  • TracL10N

    v16 v17  
    4747
    4848Can it be useful? I think so. [http://projects.edgewall.com/trac/attachment/wiki/TracL10N/trac-0.9.1-templates-pt-br.tar.gz trac-0.9.1-templates-pt-br.tar.gz]
     49
     50== Temporary Workaround 2: gettext support for trac 0.9 and mod_python ==
     51
     52Adding this [http://projects.edgewall.com/trac/attachment/wiki/TracL10N/trac-0.9.0-20051108-gettext_support.patch 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).
     53
     54To translate it put your self on the trac source dir and do:
     55{{{
     56  xgettext -o trac.pot `find trac/ -name '*.py' `
     57}}}
     58Translate 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:
     59{{{
     60  msgfmt ca.po -o /usr/share/locale/ca/LC_MESSAGES/trac.mo
     61}}}
     62I'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:
     63{{{
     64  PythonHandler trac.web.modpython_frontend
     65  PythonOption  TracLocale ca_ES.UTF-8
     66}}}