示例#1
0
    def testSetGetLocale(self):
        translator = Translator('en')

        self.assertEquals('en', translator.locale)

        translator.locale = 'fr'
        self.assertEquals('fr', translator.locale)
    def testSetGetLocale(self):
        translator = Translator('en')

        self.assertEquals('en', translator.locale)

        translator.locale = 'fr'
        self.assertEquals('fr', translator.locale)
示例#3
0
    def testget_catalogue(self):
        translator = Translator('en')

        self.assertEquals(MessageCatalogue('en'), translator.get_catalogue())

        translator.locale = 'fr'
        self.assertEquals(MessageCatalogue('fr'),
                          translator.get_catalogue('fr'))
    def testget_catalogue(self):
        translator = Translator('en')

        self.assertEquals(MessageCatalogue('en'), translator.get_catalogue())

        translator.locale = 'fr'
        self.assertEquals(
            MessageCatalogue('fr'),
            translator.get_catalogue('fr'))
示例#5
0
    def testSetValidLocale(self):
        for locale, in self.getValidLocalesTests():
            translator = Translator(locale)
            translator.locale = locale

            self.assertEquals(locale, translator.locale)
    def testSetValidLocale(self):
        for locale, in self.getValidLocalesTests():
            translator = Translator(locale)
            translator.locale = locale

            self.assertEquals(locale, translator.locale)