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).)
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 likegettext
with 1 arg,pgettext
with 2 args,ngettext
with 3 args andnpgettext
with 4 args, i.e.,_(message)
,_(context, message)
,_(singular, plural, number)
or_(context, singular, plural, number)
.)