views:

301

answers:

2

Hi,

I found this cool js gettext library -> http://code.google.com/p/gettext-js/ but I don't understand how to implement it. I am using poedit to edit the translations and I can see that it works when I checkout the project and run the demo file but when I make changes to the text, the .po files don't get updated and I can't see the new text. Does anybody have any idea? Thanks!

A: 

You must invoke xgettext in order to extract the strings into a .pot file, and then run msgmerge to update the .po files. The gettext manual has all the gory details.

Ignacio Vazquez-Abrams
I was able to figure out the problem I was having. The thing is that when making changes to the language I had to rescan all the files with Poedit. So I had to first add the correct paths for that project and then I had to use Python's parser for *.js files. I also had to force python in the gettext command otherwise Poedit will complain that .js files are not understood and will try to use C/C++ to parse them.
Kentor
+1  A: 

"I also had to force python in the gettext command"

Done by File|Preferences|Parsers Edit Python Edit 'List of extensions..": .py;.js Edit "Parser commend:" xgettext --language=Python --force-po -o %o %C %K %F

Done.

Thanks for leading me there Kentor :)

Mark White