Skip to content

Commit

Permalink
Fixed a few translation related tests:
Browse files Browse the repository at this point in the history
  * 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
  • Loading branch information
jezdez committed Jan 21, 2011
1 parent ed717cb commit 8cc0670
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion django/contrib/admin/sites.py
Expand Up @@ -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):
Expand Down
Binary file modified tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.mo
Binary file not shown.
14 changes: 7 additions & 7 deletions tests/regressiontests/i18n/other/locale/de/LC_MESSAGES/django.po
Expand Up @@ -3,23 +3,22 @@
# 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"
"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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"PO-Revision-Date: 2011-01-16 17:14+0100\n"
"Last-Translator: Jannis Leidel <jannis@leidel.info>\n"
"Language-Team: de <de@li.org>\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"
Expand All @@ -37,3 +36,4 @@ msgid "%d result"
msgid_plural "%d results"
msgstr[0] "%d Resultat"
msgstr[1] "%d Resultate"

2 changes: 1 addition & 1 deletion tests/regressiontests/i18n/tests.py
Expand Up @@ -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):

Expand Down
4 changes: 2 additions & 2 deletions tests/regressiontests/templates/tests.py
Expand Up @@ -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'α + β'),
Expand Down

0 comments on commit 8cc0670

Please sign in to comment.