We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Contexts are widely used nowadays to differentiate genders in messages. For instance:
pgettext(gender, "{user_name} followed you").format(user_name)
pybabel extract ignores extraction of context when it is not a fixed in-place string but variable.
pybabel extract
echo 'pgettext(gender, "{username} followed you")' > test.py pybabel extract test.py -o /dev/stdout
#: test.py:1 msgid "{username} followed you" msgstr ""
At minimum, a placeholder msgctxt "" should be included, to allow for easy replicating of context permutations by postprocessing script.
msgctxt ""
Ideally, pybabel extract should accept a new --default-contexts parameter and generate proper permutations of the message. This would match the same feature for front-end code in i18Next extraction: https://i18next-extract.netlify.app/#/configuration?id=defaultcontexts
--default-contexts
pybabel extract test.py -o /dev/stdout --default-contexts=male,female #: test.py:1 msgctxt "male" msgid "{username} followed you" msgstr "" #: test.py:1 msgctxt "female" msgid "{username} followed you" msgstr ""
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Overview Description
Contexts are widely used nowadays to differentiate genders in messages. For instance:
pybabel extract
ignores extraction of context when it is not a fixed in-place string but variable.Steps to Reproduce
Actual Results
Expected Results
At minimum, a placeholder
msgctxt ""
should be included, to allow for easy replicating of context permutations by postprocessing script.Ideally,
pybabel extract
should accept a new--default-contexts
parameter and generate proper permutations of the message. This would match the same feature for front-end code in i18Next extraction: https://i18next-extract.netlify.app/#/configuration?id=defaultcontextsThe text was updated successfully, but these errors were encountered: