Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

translate .js files using gettext

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!

like image 727
Kentor Avatar asked Jan 28 '10 05:01

Kentor


2 Answers

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

  1. File|Preferences|Parsers
  2. Edit Python
  3. Edit "List of extensions..":
  4. *.py;*.js
  5. Edit "Parser commend:"
  6. xgettext --language=Python --force-po -o %o %C %K %F

Done.

Thanks for leading me there Kentor :)

like image 199
Mark White Avatar answered Nov 03 '22 00:11

Mark White


I think xgettext --language=perl --force-po -o %o %C %K %F (using perl rather than python) shall be a better options, as python cause problem with javascript comment which contains a single quote (unterminated string error).

like image 40
Desmond Lua Avatar answered Nov 02 '22 23:11

Desmond Lua