On Thu, Jun 07, 2012 at 10:16:41PM -0300, Willer Gomes Junior wrote: > Where are .po files? I found only xml files. > Is it necessary create?
To make a long story short, the GIMP manual is produced by compiling xml files in xmldocbook format. This fact produces very high quality result with the side effect to enable the possibility to convert it in various formats like HTML, PDF or even ODT. The HTML format enables even the on-line help system of GIMP that is much useful. The drawback is that the manual could be though as an enormous multilanguage document. It was choosen that english was the reference language even if noone of the manual developers and authors are native english speakers (and writers). In this sense English is really an inteface language. The main problem is: when we find something wrong or unupdated in a chapter or even in a single paragraph or word of the manual, the need to communicate (propagating automatically) this to all the language versions and translators arises. How do we manage all this? Answer: in the same way of the multilanguage versions of the GNU programs: using a specialized set of tools: GNU gettext. With gettext, programs dialogs, menus and messages are written in english as a template and automatic falloff language. With the gettext utils (as msgcat, msgmrg, xgettext, etc.) you can then extract a multilanguage template, separating the translation from the code and make the program switch between languages automatically. With the GIMP manual has been choosen to do exactly this: using English as a template language for all the chapters and, thanks to an utility called xml2po, extract template for all the languages. Then translator can translate the single chapters without worrying about the manual structure. Whenever the manual changes, due for example for a GIMP version switch or during the normal manual evolution, these changes are automatically reflected into all the language templates. The main language template is a .pot (.po template) file. The extracted paragraphs are written into the .po files. The only difference between the manual and multilanguage programs is that multilanguage programs usually use the compiled form of the .po files, the .mo files that the GIMP manual do not use or produce. The .po file struncture is very simple. There is a language header that define some options about the character encoding, plural forms of the specific language, translator personal infos and so on. The translation comes after the header in form of a series of couple of text: first the english template and then the translated strings. The english strings are useful not only for reference for the translator, but even for the gettext utils that thanks to those texts are able to update automatically the strings when the main reference paragraphs changes, reflecting those changes marking the strings as "fuzzy" if the change is small, or "old" if the change is large or even the referenced string does not exist anymore. Example of .po file (from po/it/gimp.po): Header: # This is an Italian catalog for the GIMP User Manual. # Copyright (C) 2002-2012 The GIMP Documentation Team # msgid "" msgstr "" "Project-Id-Version: GIMP manual 2.4.2\n" "POT-Creation-Date: 2012-06-07 17:12+0200\n" "PO-Revision-Date: 2012-06-07 17:36+0200\n" "Last-Translator: Marco Ciampa <ciam...@libero.it>\n" "Language-Team: Italian <i...@li.org>\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" Content: #: src/key-reference.xml:6(title) msgid "Keys and Mouse Reference" msgstr "Indice di riferimento tasti" #: src/key-reference.xml:9(refentrytitle) src/key-reference.xml:12(refname) #: src/key-reference.xml:18(title) src/key-reference.xml:23(para) msgid "Help" msgstr "Aiuto" [...] You see: there is even a reference of where the template string is extracted in form of a comment (marked with a # as in Unix script style) just before the template english string (msgid "...") and then the translated string (msgstr "") As said before there are out there a number of specialized editors for .po files and some powerful general purpouse editors have special extensions for handling .po files automatically. For instance I use emacs in po-mode, some others use vi with some extension easy to find in the Web, some use Eclipse and so on... Hope this super restricted info helps clearing the matter... PS: could this small digression be written to a some FAQ of the manual? Perhaps the wiki? -- Marco Ciampa +--------------------+ | Linux User #78271 | | FSFE fellow #364 | +--------------------+ _______________________________________________ gimp-docs-list mailing list firstname.lastname@example.org https://mail.gnome.org/mailman/listinfo/gimp-docs-list