mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #25915 -- Allowed language not in Django's default LANGUAGES
This fixes a regression introduced by a5f6cbce07.
Thanks Gavin Wahl for the report and Tim Graham for the review.
This commit is contained in:
BIN
tests/i18n/commands/locale/xxx/LC_MESSAGES/django.mo
Normal file
BIN
tests/i18n/commands/locale/xxx/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
21
tests/i18n/commands/locale/xxx/LC_MESSAGES/django.po
Normal file
21
tests/i18n/commands/locale/xxx/LC_MESSAGES/django.po
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-12-04 04:59-0600\n"
|
||||
"PO-Revision-Date: 2011-12-10 19:12-0300\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: xxx\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
|
||||
msgid "year"
|
||||
msgstr "reay"
|
||||
@@ -1849,3 +1849,22 @@ class TranslationFilesMissing(SimpleTestCase):
|
||||
self.patchGettextFind()
|
||||
trans_real._translations = {}
|
||||
self.assertRaises(IOError, activate, 'en')
|
||||
|
||||
|
||||
class NonDjangoLanguageTests(SimpleTestCase):
|
||||
"""
|
||||
A language non present in default Django languages can still be
|
||||
installed/used by a Django project.
|
||||
"""
|
||||
@override_settings(
|
||||
USE_I18N=True,
|
||||
LANGUAGES=[
|
||||
('en-us', 'English'),
|
||||
('xxx', 'Somelanguage'),
|
||||
],
|
||||
LANGUAGE_CODE='xxx',
|
||||
LOCALE_PATHS=[os.path.join(here, 'commands', 'locale')],
|
||||
)
|
||||
def test_non_django_language(self):
|
||||
self.assertEqual(get_language(), 'xxx')
|
||||
self.assertEqual(ugettext("year"), "reay")
|
||||
|
||||
Reference in New Issue
Block a user