wesnoth-wiki-changes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-wiki-changes] GettextForTranslators


From: wiki
Subject: [Wesnoth-wiki-changes] GettextForTranslators
Date: Fri, 24 Sep 2004 10:26 +0200

UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040917 
Firefox/0.9.3
IP: 80.58.32.170
URI: http://wesnoth.slack.it/?GettextForTranslators
 - - - - -
|| Gettext for translators ||

Wesnoth translation is now divided in several text-domains:
* wesnoth
* wesnoth-editor
* wesnoth-lib
* plus one text-domain for each campaign.

We will use the Swedish (sv) language and the wesnoth domain as example in this 
page.
There are three important files for each package translation:
* wesnoth.pot file, which contains all the strings used in the main game 
(neither editor, nor campaign strings). You
can see how a .pot file looks like in CVS:
<a
href="http://savannah.nongnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/po/wesnoth.pot?rev=HEAD&content-type=text/vnd.viewcvs-markup";>Current
 CVS version</a>.
* sv/wesnoth.po, the file containing the translation, you can see how a .po 
file looks like in CVS:
<a
href="http://savannah.nongnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/po/sv/wesnoth.po?rev=HEAD&content-type=text/vnd.viewcvs-markup";>Current
CVS version</a>.
* sv/wesnoth.gmo, which is a binary version of <lang>.po the game will use for 
efficiency reasons

The first of this files, we update it every once in a while, when there is new 
or modified text,
for instance when a new campaign scenario hits the CVS.

Then, msgmerge is used to merge this new "state of the game strings" with your 
current
translations, and generate a new, up-to-date, wesnoth.po.

Then, a tool called msgfmt is called, which generates a new wesnoth.gmo file 
from your
wesnoth.po file, which will be used by the game once installed.

"make -C po update-po" does these three steps in one pass.

That was for the "Big Picture". But you really just need to be concerned about 
the po file:
translating new strings, checking "fuzzy" entries. We can handle the 
administrative tasks of
updating etc. You really don't need to bother with any of these commands, 
unless you want to
compile gmo files to check in-game.

Skovbaer is currently away, but you can send your translations to isaac (isaac 
at sindominio dot net)
, and he'll put them in game.

|| FAQ ||
* What's a fuzzy string?
 * It's a string calling for translator revision, for example, if a English 
string gets a
small change and you run the msgmerge program, it will mark the translation of 
that string
fuzzy. When we switched to gettext we marked all translations as fuzzy as lots 
of them where outdated.
* My language needs a different font to get displayed correctly
 * Currently Wesnoth uses two different fonts, Vera and Bepa Roman. The Bepa 
Roman font should
display correctly cyrillic and other symbols. You can have Wesnoth using 
Bepa-Roman just by
translating in your .po file the string "Vera.ttf" as "Bepa-Roman.ttf".
* What should I do to insert a newline in a string?
 * If you want to insert a newline in a string you need to include the pair of 
characters "\n". You can use normal
newlines as you wish as they don't affect the translation.
* What should I do with strings like "Prefs section^General"?
 * There are ambiguous strings which should be translated in a different way 
depending on where
they appear. For example, we have "General" in the preferences as "General 
preferences" and we can
also have "a General". This strings can have different translations for a given 
language, so we use
"context" to solve this. The prefix only tries to give a hint about the string, 
and should be not translated,
for example:

   msgid "Prefs section^General"
   msgstr "General"

* Who can I ask for further information?
 * You can ask Cedric, Yann or Isaac in IRC (irc.freenode.net, #wesnoth), if 
you don't like IRC,
send a mail to isaac at sindominio dot net.
* Why is spacing in translated in-scenario choices messed up?
 * Because of commas, they have special meaning in menu items.  Prefix each 
comma in item translations with two
backslashes, and also see http://www.wesnoth.org/forum/viewtopic.php?t=3069
* How do I quickly test PO file changes?
 * When you modify a PO file, run "make update-gmo" in the main po directory to 
create a new MO file, then run "make
install" there to install the new MO file.
 * Then force cache rebuild. This is tricky -- if you only update MO files, the 
game may use a cached (i.e., old)
version letting you wonder why it still displays the old translation. Either 
change game.cfg modification time, e.g.
with "touch /usr/local/share/wesnoth/game.cfg", or delete the corresponding 
cache[s] in ~/.wesnoth/cache.

|| Tools ||

There are several tools to work with .po files:
* <a href="http://i18n.kde.org/tools/kbabel/";>KBabel</a> (Unix KDE)
* <a href="http://gtranslator.sourceforge.net/";>GTranslator</a> (Unix Gnome)
* <a href="http://poedit.sourceforge.net/";>poEdit</a> (Multiplatform)
* <a href="http://www.gnu.org/software/emacs/emacs.html";>Emacs with po-mode</a> 
(Multiplatform)
* <a href="http://www.vim.org/";>Vim</a> with <a 
href="http://www.vim.org/scripts/script.php?script_id=695";>PO
plug-in</a> (Multiplatform)

Of course, you can edit po files with any UTF-8 capable text editor, but
the tools listed above have great advantages over any text editor regarding .po 
translation, like going to
next fuzzy/untranslated string, searching only in specific fields (msgid, 
msgstr, comment), ...

||See Also||

* GettextForWesnothDevelopers
* <a href="http://gettext.wesnoth.org/";>Provisional statistics</a>











reply via email to

[Prev in Thread] Current Thread [Next in Thread]