[Github-comments] [geany-plugins] GeanyPy: plugins has no translation strings (#272)

Colomban Wendling notifications at xxxxx
Mon Jan 18 18:55:46 UTC 2016


@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:
```python-backtrace
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](https://docs.python.org/dev/library/gettext.html?highlight=ldgettext#class-based-api)
```python
import gettext
t = gettext.translation('geany-plugins', '...')
_ = t.gettext
```
or the one here after binding the textdomain with [`gettext.bindtextdomain()`](https://docs.python.org/dev/library/gettext.html?highlight=ldgettext#gettext.bindtextdomain).

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/272#issuecomment-172622420
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160118/90ff28ff/attachment.html>


More information about the Github-comments mailing list