jsxgettext icon indicating copy to clipboard operation
jsxgettext copied to clipboard

handlebars trans func tag not detected when in another block tag

Open alex-kowalczyk opened this issue 10 years ago • 1 comments

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.

alex-kowalczyk avatar May 02 '14 11:05 alex-kowalczyk

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.

BYK avatar May 02 '14 17:05 BYK