| 1 |
from gettext import ( |
| 2 |
gettext as foo, |
| 3 |
ngettext as nfoo, |
| 4 |
pgettext as pfoo, |
| 5 |
npgettext as npfoo, |
| 6 |
gettext as bar, |
| 7 |
gettext as _, |
| 8 |
) |
| 9 |
|
| 10 |
foo('bar') |
| 11 |
foo('bar', 'baz') |
| 12 |
|
| 13 |
nfoo('cat', 'cats', 1) |
| 14 |
nfoo('dog', 'dogs') |
| 15 |
|
| 16 |
pfoo('context', 'bar') |
| 17 |
|
| 18 |
npfoo('context', 'cat', 'cats', 1) |
| 19 |
|
| 20 |
# This is an unknown keyword and should be ignored |
| 21 |
bar('baz') |
| 22 |
|
| 23 |
# 'nfoo' requires at least 2 arguments |
| 24 |
nfoo('dog') |
| 25 |
|
| 26 |
# 'pfoo' requires at least 2 arguments |
| 27 |
pfoo('context') |
| 28 |
|
| 29 |
# 'npfoo' requires at least 3 arguments |
| 30 |
npfoo('context') |
| 31 |
npfoo('context', 'cat') |
| 32 |
|
| 33 |
# --keyword should override the default keyword |
| 34 |
_('overridden', 'default') |