Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handlebars trans func tag not detected when in another block tag #56

Open
alex-kowalczyk opened this issue May 2, 2014 · 1 comment

Comments

@alex-kowalczyk
Copy link

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.

@BYK
Copy link
Collaborator

BYK commented May 2, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants