Permalink
Browse files

Revert "locale: Fix incorrect locale name for zh-Hans."

This reverts commit ba8dc62.

As best I can tell, the old configuration was correct for what Django
wanted.  Further testing is required, but this at least brings
.tx/config to match the actual filenames; I think our Chinese
translations have been broken until now.
  • Loading branch information...
timabbott committed Oct 6, 2017
1 parent 0f2e4a5 commit fe6a04cbdbd10134941b7e617cb12c4192d2710f
View
@@ -1,5 +1,6 @@
[main]
host = https://www.transifex.com
lang_map = zh-Hans: zh_Hans, zh-Hant: zh_Hant
[zulip.djangopo]
source_file = static/locale/en/LC_MESSAGES/django.po
@@ -40,10 +40,11 @@ def test_accept_language_header(self):
languages = [('en', u'Register'),
('de', u'Registrieren'),
('sr', u'Региструј се'),
('zh-hans', u'注册'),
]
for lang, word in languages:
response = self.fetch('get', '/login/', 200,
response = self.fetch('get', '/integrations/', 200,
HTTP_ACCEPT_LANGUAGE=lang)
self.assert_in_response(word, response)
@@ -52,25 +53,27 @@ def test_cookie(self):
languages = [('en', u'Register'),
('de', u'Registrieren'),
('sr', u'Региструј се'),
('zh-hans', u'注册'),
]
for lang, word in languages:
# Applying str function to LANGUAGE_COOKIE_NAME to convert unicode
# into an ascii otherwise SimpleCookie will raise an exception
self.client.cookies = SimpleCookie({str(settings.LANGUAGE_COOKIE_NAME): lang})
response = self.fetch('get', '/login/', 200)
response = self.fetch('get', '/integrations/', 200)
self.assert_in_response(word, response)
def test_i18n_urls(self):
# type: () -> None
languages = [('en', u'Register'),
('de', u'Registrieren'),
('sr', u'Региструј се'),
('zh-hans', u'注册'),
]
for lang, word in languages:
response = self.fetch('get', '/{}/login/'.format(lang), 200)
response = self.fetch('get', '/{}/integrations/'.format(lang), 200)
self.assert_in_response(word, response)

0 comments on commit fe6a04c

Please sign in to comment.