2025-11-13 11:52:21 +11:00
|
|
|
from bouquin import strings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_load_strings_uses_system_locale_and_fallback():
|
|
|
|
|
# pass a bogus locale to trigger fallback-to-default
|
|
|
|
|
strings.load_strings("zz")
|
|
|
|
|
assert strings._("next") # key exists in base translations
|
2025-11-14 11:41:55 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_load_strings_french():
|
|
|
|
|
strings.load_strings("fr")
|
|
|
|
|
assert strings._("today") == "Aujourd'hui" # translation exists in French
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_load_strings_italian():
|
|
|
|
|
strings.load_strings("it")
|
|
|
|
|
assert strings._("today") == "Oggi" # translation exists in Italian
|