adonthell-general
[Top][All Lists]
Advanced

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

Re: [Adonthell-general] How to test translations?


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

Dies ist G o o g l e s Cache von http://oka08.ihep.su/adonthell/i18n/.
G o o g l es Cache enthält einen Schnappschuss der Webseite, der während des Webdurchgangs aufgenommenen wurde.
Unter Umständen wurde die Seite inzwischen verändert.Klicken Sie hier, um zur aktuellen Seite ohne Hervorhebungen zu gelangen.
Um einen Link oder ein Bookmark zu dieser Seite herzustellen, benutzen Sie bitte die folgende URL: http://www.google.com/search?q=cache:aqZi1SMGup0J:oka08.ihep.su/adonthell/i18n/+%2Badonthell+%2Brussian&hl=de&ie=UTF-8


Google steht zu den Verfassern dieser Seite in keiner Beziehung.
Diese Suchbegriffe wurden hervorgehoben: adonthell russian 

Translation of Adonthell into other languages

This page explains how to make translation of Adonthell demo game Wastesedge 0.3.3 into other languages.

How to translate Wastesedge

  1. Once you have wastesedge checked out from CVS or downloaded from tar.gz go to po subdirectory.

  2. 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.

  3. Download there wastesedge-0.3.3.pot from Translation Project site. Alternatively you can just run make and it will generate brand new wastesedge.pot file for you. After file was generated make will stop with an error as you have not finished all the steps yet.
  4. Copy file wastesedge-0.3.3.pot or wastesedge.pot to ru.po

  5. 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.

  6. Run make You supposed to get msgfmt running. Here is possible output from make:
    
    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.

  7. Now setup LANG environment variable (for example LANG=ru_RU.KOI8-R) and start adonthell. Enjoy your translation!

Internationalization in Python code

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

Dialogs are usually generated with dlgedit . This tool already generate Python code which has i18n built-in.


Sasha Kushnirenko
Last modified: Tue Jan 21 05:22:56 MSK 2003


reply via email to

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