Пример #1
0
 def testUserWrittenTranslationFunction(self):
     """Test I18N : user written translation function"""
     self.assertEquals(
         pokergame.init_i18n(None, lambda text : "All your string are translated to us.")("DUMMY TEXT RETURN"),
         "DUMMY TEXT RETURN"
     )
     self.failUnlessEqual(pokergame._("Ace"), "All your string are translated to us.")
Пример #2
0
    def testTranslationFails(self):
        """Test I18N : domains/lang fails"""

        # When we do the init, we've already set it to an _() that returns
        # text.
        self.assertEquals(pokergame.init_i18n(None)("ANYTHING"), "ANYTHING")
        self.failUnlessEqual(pokergame._("Ace"), "Ace")
Пример #3
0
    def testTranslationFails(self):
        """Test I18N : domains/lang fails"""

        # When we do the init, we've already set it to an _() that returns
        # text.
        self.assertEquals(pokergame.init_i18n(None)("ANYTHING"), "ANYTHING")
        self.failUnlessEqual(pokergame._("Ace"), "Ace")
Пример #4
0
 def testUserWrittenTranslationFunction(self):
     """Test I18N : user written translation function"""
     self.assertEquals(
         pokergame.init_i18n(None, lambda text : "All your string are translated to us.")("DUMMY TEXT RETURN"),
         "DUMMY TEXT RETURN"
     )
     self.failUnlessEqual(pokergame._("Ace"), "All your string are translated to us.")
Пример #5
0
    def testWindowsSuccess(self):
        """Test I18N : windows success"""

        old_platform, pokergame.platform = pokergame.platform, FakePlatform("Windows")
        old_locale, pokergame.locale = pokergame.locale, FakeLocale("de")
        pokergame.init_i18n(path.join(TESTS_PATH, "../locale"))
        self.failUnlessEqual(pokergame._("King"), u"König".encode('utf8'))
        pokergame.platform = old_platform
        pokergame.locale = old_locale
        pokergame.init_i18n(None)
Пример #6
0
    def testWindowsFails(self):
        """Test I18N : windows fails"""

        old_platform, pokergame.platform = pokergame.platform, FakePlatform("Windows")
        old_locale, pokergame.locale = pokergame.locale, FakeLocale("de")
        pokergame.init_i18n(None)
        self.failUnlessEqual(pokergame._("King"), "King")
        pokergame.platform = old_platform
        pokergame.locale = old_locale
        pokergame.init_i18n(None)
Пример #7
0
    def testWindowsSuccess(self):
        """Test I18N : windows success"""

        old_platform, pokergame.platform = pokergame.platform, FakePlatform("Windows")
        old_locale, pokergame.locale = pokergame.locale, FakeLocale("de")
        pokergame.init_i18n(path.join(TESTS_PATH, "../locale"))
        self.failUnlessEqual(pokergame._("King"), "König")
        pokergame.platform = old_platform
        pokergame.locale = old_locale
        pokergame.init_i18n(None)
Пример #8
0
    def testWindowsFails(self):
        """Test I18N : windows fails"""

        old_platform, pokergame.platform = pokergame.platform, FakePlatform("Windows")
        old_locale, pokergame.locale = pokergame.locale, FakeLocale("de")
        pokergame.init_i18n(None)
        self.failUnlessEqual(pokergame._("King"), "King")
        pokergame.platform = old_platform
        pokergame.locale = old_locale
        pokergame.init_i18n(None)