From fe6a04cbdbd10134941b7e617cb12c4192d2710f Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 6 Oct 2017 10:06:41 -0700 Subject: [PATCH] Revert "locale: Fix incorrect locale name for zh-Hans." This reverts commit ba8dc621322619aefdea7097e0ce8274e44a0bd9. 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. --- .tx/config | 1 + .../locale/{zh-Hans => }/zh_Hans/LC_MESSAGES/django.po | 0 static/locale/{zh-Hans => }/zh_Hans/translations.json | 0 zerver/tests/test_i18n.py | 9 ++++++--- 4 files changed, 7 insertions(+), 3 deletions(-) rename static/locale/{zh-Hans => }/zh_Hans/LC_MESSAGES/django.po (100%) rename static/locale/{zh-Hans => }/zh_Hans/translations.json (100%) diff --git a/.tx/config b/.tx/config index e794e0bf28..7459abdb36 100644 --- a/.tx/config +++ b/.tx/config @@ -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 diff --git a/static/locale/zh-Hans/zh_Hans/LC_MESSAGES/django.po b/static/locale/zh_Hans/LC_MESSAGES/django.po similarity index 100% rename from static/locale/zh-Hans/zh_Hans/LC_MESSAGES/django.po rename to static/locale/zh_Hans/LC_MESSAGES/django.po diff --git a/static/locale/zh-Hans/zh_Hans/translations.json b/static/locale/zh_Hans/translations.json similarity index 100% rename from static/locale/zh-Hans/zh_Hans/translations.json rename to static/locale/zh_Hans/translations.json diff --git a/zerver/tests/test_i18n.py b/zerver/tests/test_i18n.py index 675d398923..150ebc7d16 100644 --- a/zerver/tests/test_i18n.py +++ b/zerver/tests/test_i18n.py @@ -40,10 +40,11 @@ class TranslationTestCase(ZulipTestCase): 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,6 +53,7 @@ class TranslationTestCase(ZulipTestCase): languages = [('en', u'Register'), ('de', u'Registrieren'), ('sr', u'Региструј се'), + ('zh-hans', u'注册'), ] for lang, word in languages: @@ -59,7 +61,7 @@ class TranslationTestCase(ZulipTestCase): # 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): @@ -67,10 +69,11 @@ class TranslationTestCase(ZulipTestCase): 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)