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

Feature request: Support gettext-like "t" specifier in keywords #1014

Closed
jeanas opened this issue Jun 14, 2023 · 0 comments · Fixed by #1015
Closed

Feature request: Support gettext-like "t" specifier in keywords #1014

jeanas opened this issue Jun 14, 2023 · 0 comments · Fixed by #1015

Comments

@jeanas
Copy link
Contributor

jeanas commented Jun 14, 2023

The full description of xgettext's --keyword option is here.

pybabel extract supports a similar syntax, but it does not support the trailing "nt" to indicate that this keyword only applies when there are n arguments. This can be useful in some Python projects (example) where the _ function is variadic for convenience. (In this particular project, it behaves like gettext with 1 arg, pgettext with 2 args, ngettext with 3 args and npgettext with 4 args, i.e., _(message), _(context, message), _(singular, plural, number) or _(context, singular, plural, number).)

@akx akx closed this as completed in #1015 Oct 1, 2023
akx pushed a commit that referenced this issue Oct 1, 2023
* Support 't' specifier in keywords
* Document --keyword format
* Document parse_keywords output format and make logic more readable

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

Successfully merging a pull request may close this issue.

2 participants