Re: xml2po Error !



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




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