Skip to content

Commit

Permalink
Revert "locale: Fix incorrect locale name for zh-Hans."
Browse files Browse the repository at this point in the history
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 fe6a04c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions zerver/tests/test_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)


Expand Down

0 comments on commit fe6a04c

Please sign in to comment.