def test_each_lang(self): langs = set(available_translations()) - {'en_GB'} for lang in langs: translate = set_up_gettext(lang) for text in REQUIRED_TRANSLATIONS: translated = translate(text) assert translated msg = "'{text}' is untranslated for {lang}".format(**locals()) assert translated != text, msg
def test_binding_uses_settings_locale(): with NewLocale("fr_FR"): _ = set_up_gettext("en_GB.UTF-8") assert _("favorites") == "favourites"
def test_gettext_uses_fallback(): _ = set_up_gettext("fr_FR.UTF-8") assert _("favorites") == "favorites"
def test_binding_respects_language(): _ = set_up_gettext("en_US.UTF-8") assert _("favorites") == "favorites"
def test_some_german_works(): _ = set_up_gettext("de_DE.UTF-8") assert _("favorites") == "Favoriten" assert _("Playing mix of {genres}") == "Spiele eine Mischung aus {genres}"
def test_some_french_works(): _ = set_up_gettext("fr.UTF-8") assert _("favorites") == "favoris" french = "La lecture aléatoire est maintenant désactivée" assert _("Shuffle is now off") == french
def test_gettext_uses_fallback(): _ = set_up_gettext(UNSUPPORTED_LOCALE) assert _("favorites") == "favorites"