Хотел с ними поработать. Но не смог подступиться.
import gettext f = open('messages.mo','r') cat = gettext.GNUTranslations() print cat.gettext('marker')
Результат:
python make_def.py
Traceback (most recent call last):
File "make_def.py", line 6, in <module>
print cat.gettext('marker')
File "C:\Python26\lib\gettext.py", line 345, in gettext
tmsg = self._catalog.get(message, missing)
AttributeError: GNUTranslations instance has no attribute '_catalog'
Если сделать
import gettext f = open('messages.mo','r') cat = gettext.GNUTranslations(f) print cat.gettext('marker')
получаем:
python make_def.py
Traceback (most recent call last):
File "make_def.py", line 4, in <module>
cat = gettext.GNUTranslations(f)
File "C:\Python26\lib\gettext.py", line 180, in __init__
self._parse(fp)
File "C:\Python26\lib\gettext.py", line 287, in _parse
tlen, toff = unpack(ii, buf[transidx:transidx+8])
struct.error: unpack requires a string argument of length 8
Что я делаю не так? :(