FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Extract Python messages in nested gettext calls · Issue #487 · python-babel/babel · GitHub

Repository navigation

Extract Python messages in nested gettext calls #487

Closed

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL