[[PageOutline(2-4)]] = Localization (L10N) of Trac = Trac uses [http://babel.edgewall.org/ 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 === 1. Install [http://babel.edgewall.org/ Babel] version [Babel:wiki:Download#LatestRelease:0.9.4 0.9.4] [[br]] Read the [http://babel.edgewall.org/wiki/SubversionCheckout detailed installation instructions] for Babel if you want to build it from source, but you should also be able to install it with a simple `easy_install` or by using one of the packages in the Download page linked above. 1. Likewise, install [http://genshi.edgewall.org/ Genshi], from the Genshi:source:branches/experimental/advanced-i18n branch. No `easy_install` here, as you'll get some trouble running Trac trunk and other versions of Genshi together with Babel (#7834) 1. Get a svn checkout from the Trac [source:trunk trunk], e.g. `svn checkout http://svn.edgewall.org/repos/trac/trunk trac-0.12dev` === Translation Workflow === 1. Run `python setup.py extract_messages`. [[br]] This will generate the catalog template file: `trac/locale/messages.pot`. You won't need to edit that file manually. 1. Run `python setup.py update_catalog`. [[br]] This will regenerate the various string catalogs (`trac/locale/*_*/LC_MESSAGES/messages.po`), preserving the previously translated strings. [[br]] 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: [[br]] `python setup.py update_catalog -l nl_NL`. [[br]] 1. Now, open your favorite editor and add or modifiy translations for the extracted strings in the catalog for your language. See examples below. 1. Once you're done, you should test your translations: - Run `python setup.py update_catalog -l` again, for normalizing the manual edits. For example: [[br]] `python setup.py update_catalog -l nl_NL`. [[br]] 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`. [[br]] 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. [[br]] You will most probably need to use the force option (`-f`) in order to compile catalogs marked "fuzzy". [[br]] 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. == 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. {{{ #!rst ======== ========== ============ ===== ======== 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: [[TicketQuery(keywords~=l10n,milestone=0.12,status!=closed)]] This is a way by which translators for the same language can coordinate their work. === Terms (Definitions) === Consistent and careful translation of terms like [wiki:TracTimeline timeline], [wiki:TracTickets ticket], [wiki:TracReports 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: [[TitleIndex(TracTerms)]] === Open issues === - i18n infrastructure for Trac plugins (#7497) - translation of wiki pages (#1513) and help pages (TracDev/Proposals/NewHelp) - translation of text within Javascript source code - failure to start Trac (raw `NullTranslations instance has no attribute 'add'` error) when no .mo file is available [[TicketQuery(keywords~=i18n,milestone=0.12,status!=closed)]] ---- See also: [[TitleIndex(TracL10N/)]]