jsxgettext
jsxgettext copied to clipboard
handlebars trans func tag not detected when in another block tag
For the content below the translation does not work
jsxgettext -s -L handlebars -k trans NewActivityNotification.html
{{#subject}}
{{ trans "Activity in the project" }}
{{/subject}}
It seems that the cause is the following:
when parseHandlebars is called recursively, it is called with escaped quotes in string.
parseHandlebars
src
param is
{{ trans \"Activity in the project\" }}
temporary workaround is to add space after blocktag name - i.e. {{#subject }} ... {{/subject }}
, but it's fragile - too easy to overlook.
Hey, thanks for the bug report!
I can't estimate a resolution time but I strongly suggest running jsxgettext
using the "JavaScript" mode over the compiled templates by passing trans
as the keyword in the meantime. That's what we do at @Disqus and it works quite well and reliably.