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

Finding _("") inside a #{} #4

Open
pupeno opened this issue Mar 12, 2010 · 2 comments
Open

Finding _("") inside a #{} #4

pupeno opened this issue Mar 12, 2010 · 2 comments

Comments

@pupeno
Copy link

pupeno commented Mar 12, 2010

It seems this parser misses cases of _ if it's inside a string, like this:

"blah blah #{_("Translate")} blah blah"

This weird thing happens in the Ruby code generated by Haml.

@pupeno
Copy link
Author

pupeno commented Mar 12, 2010

There's already code that implements it: http://github.com/retoo/ruby_gettext_extractor

@mutoh
Copy link
Owner

mutoh commented Mar 13, 2010

"blah blah #{_("Translate")} blah blah"

This syntax won't be supported by gettext as translating message.

But I understood some programs such as code generator need this feature.
Currently, it's not so high priority for me to support this, but I would like to support this in the future.

ruby_gettext_extrator seems nice, but it uses ruby_parser which isn't in the ruby standard library. So I can't merge it because I think gettext should be depend on std lib only.

I think the current best solution is use to haml parser with ruby_gettext_extractor to solve your request.

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