1

I'm quite new to poEdit, and I'm successfully translating 95% of my keys in my javascript templates and files.

I use this syntax __("key"), mainly <%= __("key") %>.

But (there always is a but), for some reason, this key email in placeholder

enter code here<input type='text' name='username' placeholder='<%= _("email") %>'>

is not parsed with poEdit.

I'm using Python parser; with __ keyword. What did I miss ?

Thanks for you help

guillaumepotier
  • 7,369
  • 8
  • 45
  • 72

2 Answers2

1

You say yourself that you use the __ (double underscore) keyword. _ (single underscore) used in your other example is a different identifier, so of course it isn’t found.

As a side note, lying to the tools (be it Poedit or xgettext) about the language (as you do, this is no Python) is bound to cause… interesting… things sooner or later.

Václav Slavík
  • 6,445
  • 2
  • 28
  • 25
  • hi @vaclav, the above formatting is missleading. There is a double underscore for the second example. This is just not found it seems because already in a string. Like I said in my comment, adding PHP parser to Python parser (to parse *.js and *.html) solved my problem. But could not explain why ;) – guillaumepotier Oct 10 '13 at 14:28
0

Unlike @Vaclav said below, I finally did not rely on xgettext (and its language validation) and made my own parser (just a parser) in PHP.

Here is the open source project, if it could help some of you https://github.com/Wisembly/jsgettext

Best

guillaumepotier
  • 7,369
  • 8
  • 45
  • 72