Commit c179bd5c authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

[1.1.X] Fixed #13514 -- Corrected the process of loading multiple javascript...

[1.1.X] Fixed #13514 -- Corrected the process of loading multiple javascript translation catalogs. Thanks to jtiai for the report, to Ramiro Morales for working out the test case, and to Ramiro and Jannis for their help on the fix.

Backport of r13250 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@13253 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 2f8bb4ee
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -163,13 +163,16 @@ def javascript_catalog(request, domain='djangojs', packages=None):
        if en_catalog_missing:
            t = {}
        else:
            locale_t = {}
            for path in paths:
                try:
                    catalog = gettext_module.translation(domain, path, [locale])
                except IOError:
                    catalog = None
                if catalog is not None:
                    t = catalog._catalog
                    locale_t.update(catalog._catalog)
            if locale_t:
                t = locale_t
    src = [LibHead]
    plural = None
    if '' in t:
+5 −7
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ import re
import datetime
from django.conf import settings
from django.core.files import temp as tempfile
from django.test import TestCase
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin.models import LogEntry, DELETION
@@ -12,14 +11,15 @@ from django.contrib.admin.sites import LOGIN_FORM_KEY
from django.contrib.admin.util import quote
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.forms.util import ErrorList
from django.test import TestCase
from django.utils.cache import get_max_age
from django.utils.encoding import iri_to_uri
from django.utils.html import escape
from django.utils.translation import activate, deactivate
from django.utils.encoding import iri_to_uri

# local test models
from models import Article, BarAccount, CustomArticle, EmptyModel, \
    ExternalSubscriber, FooAccount, Gallery, ModelWithStringPrimaryKey, \
    FooAccount, Gallery, ModelWithStringPrimaryKey, \
    Person, Persona, Picture, Podcast, Section, Subscriber, Vodcast, \
    Language, Collector, Widget, Grommet, DooHickey, FancyDoodad, Whatsit, \
    Category, Plot, FunkyTag
@@ -38,9 +38,11 @@ class AdminViewBasicTest(TestCase):
    urlbit = 'admin'

    def setUp(self):
        self.old_language_code = settings.LANGUAGE_CODE
        self.client.login(username='super', password='secret')

    def tearDown(self):
        settings.LANGUAGE_CODE = self.old_language_code
        self.client.logout()

    def testTrailingSlashRequired(self):
@@ -270,26 +272,22 @@ class AdminViewBasicTest(TestCase):
        if the default language is non-English but the selected language
        is English. See #13388 and #3594 for more details.
        """
        old_language_code = settings.LANGUAGE_CODE
        settings.LANGUAGE_CODE = 'fr'
        activate('en-us')
        response = self.client.get('/test_admin/admin/jsi18n/')
        self.assertNotContains(response, 'Choisir une heure')
        deactivate()
        settings.LANGUAGE_CODE = old_language_code

    def testI18NLanguageNonEnglishFallback(self):
        """
        Makes sure that the fallback language is still working properly
        in cases where the selected language cannot be found.
        """
        old_language_code = settings.LANGUAGE_CODE
        settings.LANGUAGE_CODE = 'fr'
        activate('none')
        response = self.client.get('/test_admin/admin/jsi18n/')
        self.assertContains(response, 'Choisir une heure')
        deactivate()
        settings.LANGUAGE_CODE = old_language_code


class SaveAsTests(TestCase):
+1 −0
Original line number Diff line number Diff line
#
+482 B

File added.

No diff preview for this file type.

+20 −0
Original line number Diff line number Diff line
# 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: 2007-09-15 19:15+0200\n"
"PO-Revision-Date: 2010-05-12 12:41-0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "this app1 string is to be translated"
msgstr "il faut traduire cette chaîne de caractères de app1"
Loading