2021-04-13 10:45:05 +02:00
|
|
|
# Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
|
2020-02-23 05:57:02 +01:00
|
|
|
import anki.lang
|
|
|
|
|
|
|
|
|
|
|
|
def test_no_collection_i18n():
|
2021-03-26 00:40:41 +01:00
|
|
|
anki.lang.set_lang("zz")
|
2021-03-26 05:49:55 +01:00
|
|
|
tr = anki.lang.tr_legacyglobal
|
2020-02-23 05:57:02 +01:00
|
|
|
no_uni = anki.lang.without_unicode_isolation
|
2021-03-26 05:49:55 +01:00
|
|
|
assert no_uni(tr.statistics_reviews(reviews=2)) == "2 reviews"
|
2020-02-23 05:57:02 +01:00
|
|
|
|
2021-03-26 00:40:41 +01:00
|
|
|
anki.lang.set_lang("ja")
|
2023-06-30 09:08:36 +02:00
|
|
|
assert no_uni(tr.statistics_reviews(reviews=2)) == "2枚"
|
2021-03-27 02:56:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_legacy_enum():
|
|
|
|
anki.lang.set_lang("ja")
|
|
|
|
TR = anki.lang.TR
|
|
|
|
tr = anki.lang.tr_legacyglobal
|
|
|
|
no_uni = anki.lang.without_unicode_isolation
|
|
|
|
|
2023-06-30 09:08:36 +02:00
|
|
|
assert no_uni(tr(TR.STATISTICS_REVIEWS, reviews=2)) == "2枚"
|