adds an explicit test to detect zh_Hans (for #161)

This commit is contained in:
Marco Bonetti 2016-03-08 09:50:22 +01:00
parent 6efeb337a3
commit 786b67e810
4 changed files with 42 additions and 0 deletions

View file

@ -50,6 +50,7 @@ class RosettaTestCase(TestCase):
('fr_FR.utf8', 'French (France), UTF8'),
('bs-Cyrl-BA', u'Bosnian (Cyrillic) (Bosnia and Herzegovina)'),
('yy-Anot', u'Yet Another dummy language'),
('zh_Hans', u'Chinese (simplified)'),
)
self.__session_engine = settings.SESSION_ENGINE
@ -720,6 +721,11 @@ class RosettaTestCase(TestCase):
r = self.client.get(reverse('rosetta-pick-file'))
self.assertTrue(os.path.normpath('locale/yy_Anot/LC_MESSAGES/django.po') in str(r.content))
def test_38_issue_161_more_weird_locales(self):
r = self.client.get(reverse('rosetta-pick-file') + '?filter=all')
r = self.client.get(reverse('rosetta-pick-file'))
self.assertTrue(os.path.normpath('locale/zh_Hans/LC_MESSAGES/django.po') in str(r.content))
# Stubbed access control function
def no_access(user):

View file

@ -0,0 +1,34 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-14 02:28-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: templates/test.html:3
msgid "Some text to translate"
msgstr ""
#: templates/test.html:5
#, python-format
msgid ""
"\n"
"one bottle of beer on the wall\n"
msgid_plural ""
"\n"
"%(num_bottles)s bottles of beer on the wall\n"
msgstr[0] ""
msgstr[1] ""

View file

@ -60,11 +60,13 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware'
)
# Note: languages are overridden in the test runner
LANGUAGES = (
('bs-Cyrl-BA', u'Bosnian (Cyrillic) (Bosnia and Herzegovina)'),
('ja', u'日本語'),
('xx', u'XXXXX'),
('fr', u'French'),
('zh_Hans', u'Chinese (Simplified)'),
('fr_FR.utf8', u'French (France), UTF8'),
)