Пример #1
0
def lval0():
	"""
	Return an empty localized value instance.
	"""
	obj = uit.LocalizedValue()
	uit.set_language('fr')
	return obj
Пример #2
0
def ldict0():
	"""
	Return an empty localized dictionary instance.
	"""
	obj = uit.LocalizedDictionary()
	uit.set_language('fr')
	return obj
Пример #3
0
 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'])
Пример #4
0
	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'])
Пример #5
0
	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']
Пример #6
0
 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'])
Пример #7
0
 def setUp(self):
     """Create object."""
     self.obj = uit.LocalizedValue()
     uit.set_language('fr')
Пример #8
0
	def init(self):
		uit.set_language(str(self.locale))
Пример #9
0
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)
Пример #11
0
	def init(self):
		# set the language in order to return the correctly localized labels/descriptions
		uit.set_language( self.locale.language )
Пример #12
0
	def setUp(self):
		"""Create object."""
		self.obj = uit.LocalizedDictionary()
		uit.set_language('fr')
Пример #13
0
	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'])
Пример #14
0
	def setUp(self):
		"""Create object."""
		self.obj = uit.LocalizedValue()
		uit.set_language('fr')
Пример #15
0
 def setUp(self):
     """Create object."""
     self.obj = uit.LocalizedDictionary()
     uit.set_language('fr')
Пример #16
0
 def init(self):
     # set the language in order to return the correctly localized labels/descriptions
     uit.set_language(self.locale.language)
Пример #17
0
	def test_default(self, lval, ldict):
		"""Test default set_language() setting."""
		uit.set_language('fr')
		assert 'baz' == lval.get()
		assert 'baz' == ldict['val']
 def init(self):
     uit.set_language(str(self.locale))
Пример #19
0
def set_language( lang ):
	"""Set the default language."""
	global _locale
	_locale = lang
	uit.set_language(lang)