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

Extract Python messages in nested gettext calls #487

Closed
sublee opened this issue Mar 31, 2017 · 0 comments · Fixed by #488
Closed

Extract Python messages in nested gettext calls #487

sublee opened this issue Mar 31, 2017 · 0 comments · Fixed by #488
Labels

Comments

@sublee
Copy link
Contributor

sublee commented Mar 31, 2017

When Babel extracts messages from Python code, it ignores _(...) in another _(...).

My _ is slightly customized to accept **kwargs for formatting. I guess it is one of common patterns. So I can write like this code:

#: TRANSLATOR: Users can have one or more fruits.
text = _('You have {fruit}!', fruit=_('an apple'))

Babel extracts only You have {fruit}! in the above code. There's no an apple. But at the same case in C#, xgettext can extract both of the messages. So I think this is a bug in Babel.

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

Successfully merging a pull request may close this issue.

2 participants