From 8cc0670c5456d12c06c901e2c8edb3b354edf13e Mon Sep 17 00:00:00 2001 From: jezdez Date: Fri, 21 Jan 2011 19:36:26 +0000 Subject: [PATCH] Fixed a few translation related tests: * Extended the admin i18n view to also take the admin translation catalogues into account. * Use a translation string from the core translations to test LOCALE_PATHS. * Fixed Russian translation of singular forms. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15273 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/sites.py | 2 +- .../i18n/other/locale/de/LC_MESSAGES/django.mo | Bin 611 -> 600 bytes .../i18n/other/locale/de/LC_MESSAGES/django.po | 14 +++++++------- tests/regressiontests/i18n/tests.py | 2 +- tests/regressiontests/templates/tests.py | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py index 0aa730f79e..c1f6970193 100644 --- a/django/contrib/admin/sites.py +++ b/django/contrib/admin/sites.py @@ -284,7 +284,7 @@ def i18n_javascript(self, request): from django.views.i18n import javascript_catalog else: from django.views.i18n import null_javascript_catalog as javascript_catalog - return javascript_catalog(request, packages='django.conf') + return javascript_catalog(request, packages=['django.conf', 'django.contrib.admin']) @never_cache def logout(self, request, extra_context=None): diff --git a/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.mo b/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.mo index b662e9392da234d2b1a618dcc20ea5d84b0da19c..6db1cb1a8ccf488dc7336d0fd707f6693a873a26 100644 GIT binary patch delta 237 zcmW-ZKMR6D7>Ca?h=`V!pyi0RFzzG_M4~y|a*qQ~G4uq_K17QpP7QsK);>jhTc4tz zzVN&c@87TaG4IRBB!pbS1XN%So?r-G;A9Z;hNocBBcu;I@CQdLg_ffSibLrJ|*HV>mRgCvs;@7aG>0y4h< delta 268 zcmcb?@|b0UNAeIK=ML^5}#QT6ao{@p!IFObEVs$1424*1b2&5%| zv@4Ki0n%|m8mNo`NPz)J45SVOSV4qKVo9ogNoH;;LvDUvNrpmRVs0vnZ(=1w@x*x+ z`~i;6-j43B3Sq86!Jhtp6CVY~M7lZ#>H7NXx;QF$_*?mUYDf9|xpMg=7MJLT6eZ>r z=OmWo7g;H|h5Gm?_&NHzD%iOCI(qszIJ&q5xdsQ@0hQ*ZmnNpC>V~8y=2|KEIQqGV cg6y#I@tHh@v5yPrqS9RbsMO4o$!bhS0Lt(>WdHyG diff --git a/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po b/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po index fa297e5683..1aeee6983c 100644 --- a/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po +++ b/tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po @@ -3,23 +3,22 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: django tests\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-02-14 17:33+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2011-01-16 17:14+0100\n" +"Last-Translator: Jannis Leidel \n" +"Language-Team: de \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" #: models.py:3 -msgid "Date/time" -msgstr "Datum/Zeit (LOCALE_PATHS)" +msgid "Time" +msgstr "Time (LOCALE_PATHS)" #: models.py:5 msgctxt "month name" @@ -37,3 +36,4 @@ msgid "%d result" msgid_plural "%d results" msgstr[0] "%d Resultat" msgstr[1] "%d Resultate" + diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index deba5d1d03..a9d9f28fd3 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -689,7 +689,7 @@ def tearDown(self): super(LocalePathsResolutionOrderI18NTests, self).tearDown() def test_locale_paths_translation(self): - self.assertUgettext('Date/time', 'LOCALE_PATHS') + self.assertUgettext('Time', 'LOCALE_PATHS') class ProjectResolutionOrderI18NTests(ResolutionOrderI18NTests): diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index 99776e611a..99b4367f60 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -1203,8 +1203,8 @@ def get_template_tests(self): 'legacyi18n26': ('{% load i18n %}{% blocktrans with myextra_field as extra_field count number as counter %}singular {{ extra_field }}{% plural %}plural{% endblocktrans %}', {'number': 1, 'myextra_field': 'test'}, "singular test"), # translation of singular form in russian (#14126) - 'i18n27': ('{% load i18n %}{% blocktrans count counter=number %}1 result{% plural %}{{ counter }} results{% endblocktrans %}', {'number': 1, 'LANGUAGE_CODE': 'ru'}, u'1 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442'), - 'legacyi18n27': ('{% load i18n %}{% blocktrans count number as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %}', {'number': 1, 'LANGUAGE_CODE': 'ru'}, u'1 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442'), + 'i18n27': ('{% load i18n %}{% blocktrans count counter=number %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %}', {'number': 1, 'LANGUAGE_CODE': 'ru'}, u'1 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442'), + 'legacyi18n27': ('{% load i18n %}{% blocktrans count number as counter %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %}', {'number': 1, 'LANGUAGE_CODE': 'ru'}, u'1 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442'), # simple translation of multiple variables 'i18n28': ('{% load i18n %}{% blocktrans with a=anton b=berta %}{{ a }} + {{ b }}{% endblocktrans %}', {'anton': 'α', 'berta': 'β'}, u'α + β'),