示例#1
0
	def test_gettext_lazy(self):
		text = LazyT('McAvoy or Stewart? These timelines are confusing.')

		self.assertEqual(unicode(text), u'McAvoy or Stewart? These timelines are confusing.')

		change_language('de')
		self.assertEqual(unicode(text), u'McAvoy oder Stewart? Diese Zeitlinien sind verwirrend.')
示例#2
0
	def test_gettext_lazy(self):
		text = LazyT('McAvoy or Stewart? These timelines are confusing.')

		self.assertEqual(str(text), 'McAvoy or Stewart? These timelines are confusing.')

		change_language('de')
		self.assertEqual(str(text), 'McAvoy oder Stewart? Diese Zeitlinien sind verwirrend.')
示例#3
0
def test_gettext_lazy():
	text = LazyT('McAvoy or Stewart? These timelines are confusing.')

	assert str(text) == 'McAvoy or Stewart? These timelines are confusing.'

	change_language('de')
	assert str(text) == 'McAvoy oder Stewart? Diese Zeitlinien sind verwirrend.'
示例#4
0
	def test_active_translation(self):
		change_language('de')
		self.assertEqual(T('McAvoy or Stewart? These timelines are confusing.'),
		                 'McAvoy oder Stewart? Diese Zeitlinien sind verwirrend.')

		change_language('fr')
		self.assertEqual(T('McAvoy or Stewart? These timelines are confusing.'),
		                 'McAvoy ou Stewart? Ces délais sont confus.')
示例#5
0
	def test_active_translation(self):
		change_language('de')
		self.assertEqual(T('McAvoy or Stewart? These timelines are confusing.'),
		                 u'McAvoy oder Stewart? Diese Zeitlinien sind verwirrend.')

		change_language('fr')
		self.assertEqual(T('McAvoy or Stewart? These timelines are confusing.'),
		                 u'McAvoy ou Stewart? Ces délais sont confus.')
示例#6
0
def test_disable_translations():
    change_language('de')
    assert T('McAvoy or Stewart? These timelines are confusing.') ==\
      'McAvoy oder Stewart? Diese Zeitlinien sind verwirrend.'

    with disable_translations():
        assert T('McAvoy or Stewart? These timelines are confusing.') ==\
          'McAvoy or Stewart? These timelines are confusing.'

    assert T('McAvoy or Stewart? These timelines are confusing.') ==\
      'McAvoy oder Stewart? Diese Zeitlinien sind verwirrend.'
    def update_languages(self, data=None):
        if data is None:
            data = self._setting.get(UH_MODULE, "Language")

        language = LANGUAGENAMES.get_by_value(data)
        change_language(language)
	def apply(self):
		data = self.get(SETTINGS.UH_MODULE, "Language")
		language = LANGUAGENAMES.get_by_value(data)
		change_language(language)
示例#9
0
	def apply(self):
		data = self.get(SETTINGS.UH_MODULE, "Language")
		language = LANGUAGENAMES.get_by_value(data)
		change_language(language)
示例#10
0
 def _apply_Language(self, old, new):
     language = LANGUAGENAMES.get_by_value(new)
     change_language(language)
示例#11
0
 def _on_Language_changed(self, old, new):
     language = LANGUAGENAMES.get_by_value(new)
     change_language(language)
示例#12
0
	def _on_Language_changed(self, old, new):
		language = LANGUAGENAMES.get_by_value(new)
		change_language(language)
示例#13
0
    def update_languages(self, data=None):
        if data is None:
            data = self._setting.get(UH_MODULE, "Language")

        language = LANGUAGENAMES.get_by_value(data)
        change_language(language)
	def _apply_Language(self, old, new):
		language = LANGUAGENAMES.get_by_value(new)
		change_language(language)