Seite 1 von 1

Lokalisieren klappt nicht

Verfasst: Freitag 20. November 2009, 19:22
von bauerj
Hallo,

ich bin gerade dabei ein python Programm mit gettext zu lokalisieren.
Ich habe also:

Code: Alles auswählen

mport gettext 
trans = gettext.translation("programm", "locale", ["de"]) 
trans.install()
eingefügt

Aus allen Textschnipsel _('text') gemacht

Per "pygettext programm.py" den .pot Katalog erstellt.

Daraus eine Datei 'programm'/locale/LC_MESSAGES/de/programm.po
erstellt.

Wenn ich jetzt das Programm starten wil, meldet die Konsole aber:

Traceback (most recent call last):
File "./programm.py", line 36, in <module>
trans = gettext.translation("programm", "locale", ["de"])
File "/usr/lib/python2.6/gettext.py", line 484, in translation
raise IOError(ENOENT, 'No translation file found for domain', domain)
IOError: [Errno 2] No translation file found for domain: 'programm'

Was habe ich falsch gemacht?
Vielen Dank im Vorraus

Verfasst: Samstag 21. November 2009, 08:52
von tordmor
http://docs.python.org/library/gettext. ... nd-modules
Using the msgfmt.py [4] program (in the Tools/i18n directory), you take the .po files from your translators and generate the machine-readable .mo binary catalog files. The .mo files are what the gettext module uses for the actual translation processing during run-time.

Verfasst: Samstag 21. November 2009, 10:57
von bauerj
Oh, hab ich vergessen :oops: Eine programm.mo gibt es natürlich auch.