Beispiel #1
0
def test_activate():
    l10n.deactivate_all()
    l10n.activate('fr')
    # This string is from the AMO .po file
    a_text = "My Account"
    p_text = "Mon compte"
    eq_(p_text, _(a_text))
    l10n.deactivate_all()
Beispiel #2
0
def test_cached_activate():
    """
    Make sure the locale is always activated properly, even when we hit a
    cached version.
    """
    l10n.deactivate_all()
    l10n.activate('fr')
    eq_(translation.get_language(), 'fr')
    l10n.activate('vi')
    eq_(translation.get_language(), 'vi')
    l10n.activate('fr')
    eq_(translation.get_language(), 'fr')
    l10n.activate('de')
    eq_(translation.get_language(), 'de')
    l10n.activate('fr')
    eq_(translation.get_language(), 'fr')
    l10n.activate('vi')
    eq_(translation.get_language(), 'vi')
Beispiel #3
0
def teardown():
    if os.path.isdir(LOCALEDIR):
        shutil.rmtree(LOCALEDIR)
    l10n.deactivate_all()