Ejemplo n.º 1
0
def test_underscore_localization():
    i18n.localize("de")
    assert i18n.get_current_language() == "de"
    assert i18n._("Age") == "Alter"
    i18n.unlocalize()
    assert i18n._("Age") == "Age"
    assert i18n.get_current_language() is None
Ejemplo n.º 2
0
def test_lazy_localization():
    lazy_str = i18n._l("Age")

    assert lazy_str == "Age"

    i18n.localize("de")
    assert lazy_str == "Alter"

    i18n.unlocalize()
    assert lazy_str == "Age"