Closed tombertrand closed 8 years ago
Your last question first: yes, you can specify your own keywords with the --keyword
parameter.
Could you paste an example file for which plural forms are not being extracted?
I'm having this in a .hbs template, (not both lines at once, I'm replacing for testing)
<h2>{{ngettext "Payment" "Payments" 3}}</h2> <!-- works -->
<h2>{{n_ "Payment" "Payments" 3}}</h2> <!-- no output for "payment" to be found inside the po file -->
If you run xgettext-template --help
you see the default plural keyword is only ngettext
.
You'll need to specify your own for this to work.
These options should do it:
-k gettext -k _ -k ngettext:1,2 -k n_:1,2
oh! thank you for the very quick reply
works like a charm
Hey, I've been doing experiments and trying the plural form of words. I'm having difficulties to extract text using the
n_
shorthand suggested in the gettext-handlebars whilengettext
works as expected.Result from
ngettext
On a side note, would it be possible to run the
xgettext-template
cmd using different helpers name? for example, I would like to use{{l10n "text"}}
instead of{{_ "text"}}
?Thanks.