2017-11-05 10:25:02 +00:00
|
|
|
import gettext
|
|
|
|
|
2021-05-27 05:50:04 +00:00
|
|
|
msg = gettext.gettext("yes")
|
|
|
|
assert msg == "yes"
|
2017-11-05 10:25:02 +00:00
|
|
|
|
2021-05-27 05:50:04 +00:00
|
|
|
msg = gettext.ngettext("one", "two", 1)
|
|
|
|
assert msg == "one"
|
2017-11-05 10:25:02 +00:00
|
|
|
|
2021-05-27 05:50:04 +00:00
|
|
|
msg = gettext.ngettext("one", "two", 2)
|
|
|
|
assert msg == "two"
|
2017-11-05 10:25:02 +00:00
|
|
|
|
2021-05-27 05:50:04 +00:00
|
|
|
msg = gettext.ngettext("one", "two", 0)
|
|
|
|
assert msg == "two"
|
2017-11-05 10:25:02 +00:00
|
|
|
|
2021-05-27 05:50:04 +00:00
|
|
|
msg = gettext.ngettext("one", "two", "three")
|
|
|
|
assert msg == "two"
|