|
From: | Kai Sterker |
Subject: | Re: [Adonthell-general] How to test translations? |
Date: | Wed, 30 Jul 2003 10:38:51 +0200 |
Am Mittwoch, 30.07.03 um 10:26 Uhr schrieb Alexandre Courbot:
I wrote and tested it a while ago, but I beleive it is true. http://oka08.ihep.su/adonthell/i18n/ Feel free to grab it and put on Adonthell Web page if need be.The page won't load - just tried right now. It your server down?
Seems so, However, it was still in google's cache. It's attached. I'll also add it to our site, either today or one of the following days.
Seems you have to run msgfmt on the .po file.Note that you can also preview a translation in dlgedit, once you have the .gmo file. Load the dialogue you want to check, then select Preview t10n from the Dialogue menu. For this to work, it doesn't matter where the .gmo file is located.
Thanks again, Sasha. Kai
|
This page explains how to make translation of Adonthell demo game Wastesedge 0.3.3 into other languages.
Once you have wastesedge checked out from CVS or downloaded from tar.gz go to po subdirectory.
Edit file LINGUAS and include there 2-letter code of language you are going to translate to (fr=french, it=italian, ru=russian, etc). For example ru
Note there is no cyrillic font in wastesedge at the moment. But it is going to be fixed ... soon.
Copy file wastesedge-0.3.3.pot or wastesedge.pot to ru.po
Edit file ru.po with Emacs, as it has great support for editing PO files. Translate as much as you can, but you do not have to translate all of it. Untranslated messages will appear in English. To see quick results just translate Menu entries at the end of the file.
Don't forget to edit header of the file which shows creation date, project name, charset and so on. Otherwise an error will stop make execution. Check a piece of ru.po here as an example.
rm -f ru.gmo && /usr/bin/msgfmt -c --statistics -o ru.gmo ru.po 18 translated messages, 6 fuzzy translations, 1156 untranslated messages.
Well there is still quite a bit of messages to translate :). Anyways after running make install the binary file with translated text ru.gmo should end up in ..../games/wastesedge/locale/ru/wastesedge.mo file.
Code is aware of i18n(=internationalization) and uses gettext (>=0.11.5) library. As a lot of code is in Python there is a python interface called pygettext.py that is used for of Wastesedge. Internationalized python code looks like that:
... # -- pygettext support def _(message): return nls_translate (message) ... self.load_game.set_text (_("Load Game")) ^^^^^^^^^^^^^^ text = (_("I know you!")) ^^^^^^^^^^^^^^^^ print text ... ...Basically you use underscore to indicate the text that should be translatable.
Dialogs are usually generated with dlgedit . This tool already generate Python code which has i18n built-in.
[Prev in Thread] | Current Thread | [Next in Thread] |