Open scriptum opened 9 years ago
Would this approach need any changes on update-po procedure?
@frlan no, it would work just fine as is, just listing python files in POTFILES.in and marking strings with _()
I gave this a quick shot, and the extraction process works fine, but I can't seem to get the translations from Python, as it makes it crash somehow:
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "/tmp/_install_gtk2/lib/geany/geanypy/geany/__init__.py", line 20, in <module>
import manager
File "/tmp/_install_gtk2/lib/geany/geanypy/geany/manager.py", line 7, in <module>
t = gettext.translation('geany-plugins', '/tmp/_install_gtk2/share/locale')
File "/usr/lib/python2.7/gettext.py", line 481, in translation
t = _translations.setdefault(key, class_(fp))
File "/usr/lib/python2.7/gettext.py", line 182, in __init__
self._parse(fp)
File "/usr/lib/python2.7/gettext.py", line 317, in _parse
plural = v[1].split('plural=')[1]
IndexError: list index out of range
either using the recommend
import gettext
t = gettext.translation('geany-plugins', '...')
_ = t.gettext
or the one here after binding the textdomain with gettext.bindtextdomain()
.
While GeanyPy itself translatable, plugins included in it have no translation strings. It's easy to localize python:
or
Upd: parts of GeanyPy written in Python aren't translatable too: