def lval0(): """ Return an empty localized value instance. """ obj = uit.LocalizedValue() uit.set_language('fr') return obj
def ldict0(): """ Return an empty localized dictionary instance. """ obj = uit.LocalizedDictionary() uit.set_language('fr') return obj
def test_global(self): """Test global set_language() setting.""" uit.set_language('de') self.assertEqual('foo', self.lval.get()) self.assertEqual('foo', self.ldict['val']) uit.set_language('en') self.assertEqual('bar', self.lval.get()) self.assertEqual('bar', self.ldict['val'])
def test_global(self, lval, ldict): """Test global set_language() setting.""" uit.set_language('de') assert 'foo' == lval.get() assert 'foo' == ldict['val'] uit.set_language('en') assert 'bar' == lval.get() assert 'bar' == ldict['val']
def test_default(self): """Test default set_language() setting.""" uit.set_language('fr') self.assertEqual('baz', self.lval.get()) self.assertEqual('baz', self.ldict['val'])
def setUp(self): """Create object.""" self.obj = uit.LocalizedValue() uit.set_language('fr')
def init(self): uit.set_language(str(self.locale))
def set_language(lang): # type: (str) -> None """Set the default language.""" global _locale _locale = lang uit.set_language(lang)
def set_language(lang): """Set the default language.""" global _locale _locale = lang uit.set_language(lang)
def init(self): # set the language in order to return the correctly localized labels/descriptions uit.set_language( self.locale.language )
def setUp(self): """Create object.""" self.obj = uit.LocalizedDictionary() uit.set_language('fr')
def init(self): # set the language in order to return the correctly localized labels/descriptions uit.set_language(self.locale.language)
def test_default(self, lval, ldict): """Test default set_language() setting.""" uit.set_language('fr') assert 'baz' == lval.get() assert 'baz' == ldict['val']
def set_language( lang ): """Set the default language.""" global _locale _locale = lang uit.set_language(lang)