Re: xml2po Error !



Hi 
I ran from my terminal 
python
>>> fd = open('manual.ar.mo', 'rb')
import gettext
tr = gettext.GNUTranslations(fd)>>> >>> 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/gettext.py", line 180, in __init__
    self._parse(fp)
  File "/usr/lib/python2.7/gettext.py", line 314, in _parse
    plural = v[1].split('plural=')[1]
IndexError: list index out of range


I may have some problem with my python installation ? 

On Sun, Jul 22, 2012 at 8:02 PM, Shaun McCance <shaunm gnome org> wrote:
On Sun, 2012-07-22 at 18:34 +0300, Karam Qubsi wrote:
> thank you all
> I fixed this problem :)

Just to provide background: that problem is that itstool
does not load DTDs, which means it doesn't get the entity
definitions from DocBook, so those become parse errors.
I've opened a bug to add an option for this:

https://bugs.freedesktop.org/show_bug.cgi?id=52363

> but I'm facing with an other problem
>
> I convert the xml to pot
> and po for my lang
>
> then I edited the po and try to convert it back to xml
>
> first I convert it to mo by run the command
> msgfmt mypofile.po
>
> then it generate a mo file
>
> I try to generate the xml file back from it by :
> itstool -m mypofile.mo -o ar/ *.xml
>
> but the result is :
> Error: cannot open mo file mypofile.mo
>
> and the file is exist and all permission is sets

I can't really tell. Can you run python in the directory
with the mo file and run these commands:

fd = open('mypofile.mo', 'rb')
import gettext
tr = gettext.GNUTranslations(fd)

One of those ought to raise an exception to get the error
you're getting. Let me know what happens.

By the way, it's a good idea to use the locale as the base
name of the mo file, i.e. ar.mo. itstool sets the language
information in the XML file. You can always set the language
explicitly with the -l option, but by default itstool gets
the language name from the file name.

--
Shaun





--
Karam Qubsi
Koha Arab Translating Team
http://koha.wikibrary.org/
Wikibrary for Arab Librarians
http://wikibrary.org



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