Commits

Anonymous committed 79cac6b

Merge to trunk r1381

Comments (0)

Files changed (11)

django/bin/make-messages.py

 elif os.path.isdir('locale'):
     localedir = os.path.abspath('locale')
 else:
-    print "this script should be run from the django svn tree or your project or app tree"
+    print "This script should be run from the django svn tree or your project or app tree."
+    print "If you did indeed run it from the svn checkout or your project or application,"
+    print "maybe you are just missing the conf/locale (in the django tree) or locale (for project"
+    print "and application) directory?"
+    print "make-messages.py doesn't create it automatically, you have to create it by hand if"
+    print "you want to enable i18n for your project or application."
     sys.exit(1)
 
 (opts, args) = getopt.getopt(sys.argv[1:], 'l:d:va')

django/conf/locale/de/LC_MESSAGES/django.mo

Binary file modified.

django/conf/locale/de/LC_MESSAGES/django.po

 #: utils/timesince.py:15
 msgid "hour"
 msgid_plural "hours"
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "Stunde"
+msgstr[1] "Stunden"
 
 #: utils/timesince.py:16
 msgid "minute"

django/conf/locale/sk/LC_MESSAGES/django.mo

Binary file modified.

django/conf/locale/sk/LC_MESSAGES/django.po

 msgstr[1] "Tento mesiac"
 
 #: utils/timesince.py:14
-#, fuzzy
 msgid "day"
 msgid_plural "days"
 msgstr[0] "Dnes"
 #: utils/timesince.py:15
 msgid "hour"
 msgid_plural "hours"
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "hodina"
+msgstr[1] "hodín"
 
 #: utils/timesince.py:16
-#, fuzzy
 msgid "minute"
 msgid_plural "minutes"
-msgstr[0] "web"
-msgstr[1] "web"
+msgstr[0] "minúta"
+msgstr[1] "minút"
 
 #: models/core.py:7
 msgid "domain name"
 msgstr "Waleský"
 
 #: conf/global_settings.py:40
-#, fuzzy
 msgid "Danish"
-msgstr "Španielsky"
+msgstr "Dánsky"
 
 #: conf/global_settings.py:41
 msgid "German"

django/contrib/admin/templates/admin/index.html

             {% else %}
                 <th>{{ model.name }}</th>
             {% endif %}
-
+			{{}}
             {% if model.perms.add %}
                 <td class="x50"><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Add' %}</a></td>
             {% else %}

django/contrib/comments/templatetags/comments.py

 '''
 
 FREE_COMMENT_FORM = '''
+{% load i18n %}
 {% if display_form %}
 <form action="/comments/postfree/" method="post">
 <p>{% trans "Your name:" %} <input type="text" id="id_person_name" name="person_name" /></p>

django/core/urlresolvers.py

     (view_function, dict_of_view_function_args)
 """
 
-from django.core.exceptions import Http404, ViewDoesNotExist
+from django.core.exceptions import Http404, ImproperlyConfigured, ViewDoesNotExist
 import re
 
 class Resolver404(Http404):
         try:
             return self._urlconf_module
         except AttributeError:
-            self._urlconf_module = __import__(self.urlconf_name, '', '', [''])
+            try:
+                self._urlconf_module = __import__(self.urlconf_name, '', '', [''])
+            except ValueError, e:
+                # Invalid urlconf_name, such as "foo.bar." (note trailing period)
+                raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
             return self._urlconf_module
     urlconf_module = property(_get_urlconf_module)
 

django/utils/timesince.py

-import datetime, time
+import datetime, math, time
 from django.utils.tzinfo import LocalTimezone
 from django.utils.translation import ngettext
 
         count = since / seconds
         if count != 0:
             break
+    if count < 0:
+        return '%d milliseconds' % math.floor(delta.microseconds / 1000)
     s = '%d %s' % (count, name(count))
     if i + 1 < len(chunks):
         # Now get the second item

django/views/debug.py

+
 from django.conf import settings
 from django.core.template import Template, Context
 from django.utils.html import escape
     table.vars td, table.req td { font-family:monospace; }
     table td.code { width:100%; }
     table td.code div { overflow:hidden; }
+    table.source th { color:#666; }
+    table.source td { font-family:monospace; white-space:pre; border-bottom:1px solid #eee; }
     ul.traceback { list-style-type:none; }
     ul.traceback li.frame { margin-bottom:1em; }
     div.context { margin: 10px 0; }
     #summary { background: #ffc; }
     #summary h2 { font-weight: normal; color: #666; }
     #explanation { background:#eee; }
+    #template { background:#f6f6f6; }
     #traceback { background:#eee; }
     #requestinfo { background:#f6f6f6; padding-left:120px; }
     #summary table { border:none; background:transparent; }
     #requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; }
     #requestinfo h3 { margin-bottom:-1em; }
-    table.source td { font-family: monospace; white-space: pre; }
-    span.specific { background:#ffcab7; }
     .error { background: #ffc; }
+    .specific { color:#cc3300; font-weight:bold; }
   </style>
   <script type="text/javascript">
   //<!--
 </div>
 {% if template_info %}
 <div id="template">
-   <h2>Template</h2>
-   In template {{ template_info.name }}, error at line {{ template_info.line }}
-   <div>{{ template_info.message|escape }}</div>
+   <h2>Template error</h2>
+   <p>In template <code>{{ template_info.name }}</code>, error at line <strong>{{ template_info.line }}</strong></p>
+   <h3>{{ template_info.message|escape }}</h3>
    <table class="source{% if template_info.top %} cut-top{% endif %}{% ifnotequal template_info.bottom template_info.total %} cut-bottom{% endifnotequal %}">
    {% for source_line in template_info.source_lines %}
    {% ifequal source_line.0 template_info.line %}
-       <tr class="error"><td>{{ source_line.0 }}</td>
+       <tr class="error"><th>{{ source_line.0 }}</th>
        <td>{{ template_info.before }}<span class="specific">{{ template_info.during }}</span>{{ template_info.after }}</td></tr>
    {% else %}
-      <tr><td>{{ source_line.0 }}</td>
+      <tr><th>{{ source_line.0 }}</th>
       <td> {{ source_line.1 }}</td></tr>
    {% endifequal %}
    {% endfor %}

tests/othertests/templates.py

     # Chained filters, with an argument to the first one
     'basic-syntax29': ('{{ var|removetags:"b i"|upper|lower }}', {"var": "<b><i>Yes</i></b>"}, "yes"),
 
-    #Escaped string as argument 
+    #Escaped string as argument
     'basic-syntax30': (r"""{{ var|default_if_none:" endquote\" hah" }}""", {"var": None}, ' endquote" hah'),
-    
+
     
     ### IF TAG ################################################################
     'if-tag01': ("{% if foo %}yes{% else %}no{% endif %}", {"foo": True}, "yes"),
     'multiline01': ("""
                     Hello,
                     boys.
-                    How 
-                    are 
+                    How
+                    are
                     you
-                    gentlemen. 
-                    """, 
-                    {}, 
+                    gentlemen.
+                    """,
+                    {},
                     """
                     Hello,
                     boys.
-                    How 
-                    are 
+                    How
+                    are
                     you
-                    gentlemen. 
+                    gentlemen.
                     """  ),
     # simple translation of a string delimited by '
     'i18n01': ("{% load i18n %}{% trans 'xxxyyyxxx' %}", {}, "xxxyyyxxx"),