mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
new_admin: added more translations to the admin (mostly view functions and decorators)
git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1079 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5ef1cef158
commit
741a13e1dd
Binary file not shown.
@ -7,7 +7,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Django 1.0\n"
|
"Project-Id-Version: Django 1.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2005-11-04 15:21+0100\n"
|
"POT-Creation-Date: 2005-11-04 16:27+0100\n"
|
||||||
"PO-Revision-Date: 2005-10-08 00:03+0200\n"
|
"PO-Revision-Date: 2005-10-08 00:03+0200\n"
|
||||||
"Last-Translator: Georg Bauer <gb@bofh.ms>\n"
|
"Last-Translator: Georg Bauer <gb@bofh.ms>\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@ -42,6 +42,227 @@ msgstr "Logeintrag"
|
|||||||
msgid "log entries"
|
msgid "log entries"
|
||||||
msgstr "Logeinträge"
|
msgstr "Logeinträge"
|
||||||
|
|
||||||
|
#: contrib/admin/templatetags/admin_list.py:256
|
||||||
|
msgid "All dates"
|
||||||
|
msgstr "Alle Tage"
|
||||||
|
|
||||||
|
#: contrib/admin/views/decorators.py:22
|
||||||
|
#: contrib/admin/templates/admin/login.html:24
|
||||||
|
msgid "Log in"
|
||||||
|
msgstr "Anmelden"
|
||||||
|
|
||||||
|
#: contrib/admin/views/decorators.py:56
|
||||||
|
msgid ""
|
||||||
|
"Please log in again, because your session has expired. Don't worry: Your "
|
||||||
|
"submission has been saved."
|
||||||
|
msgstr ""
|
||||||
|
"Bitte neu anmelden, da die Session ausgelaufen ist. Keine Angst: die "
|
||||||
|
"Beiträge wurden gesichert."
|
||||||
|
|
||||||
|
#: contrib/admin/views/decorators.py:63
|
||||||
|
msgid ""
|
||||||
|
"Looks like your browser isn't configured to accept cookies. Please enable "
|
||||||
|
"cookies, reload this page, and try again."
|
||||||
|
msgstr ""
|
||||||
|
"Es sieht danach aus, das der Browser keine Cookies akzeptiert. Bitte im "
|
||||||
|
"Browser Cookies aktivieren und diese Seite neu laden."
|
||||||
|
|
||||||
|
#: contrib/admin/views/decorators.py:77
|
||||||
|
msgid "Usernames cannot contain the '@' character."
|
||||||
|
msgstr "Benutzernamen können das Zeichen '@' nicht enthalten."
|
||||||
|
|
||||||
|
#: contrib/admin/views/decorators.py:79
|
||||||
|
#, python-format
|
||||||
|
msgid "Your e-mail address is not your username. Try '%s' instead."
|
||||||
|
msgstr ""
|
||||||
|
"Die eMail-Adresse ist nicht der Benutzername. Bitte '%s' stattdessen "
|
||||||
|
"versuchen."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:78 contrib/admin/views/main.py:106
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"<h3>By %s:</h3>\n"
|
||||||
|
"<ul>\n"
|
||||||
|
msgstr ""
|
||||||
|
"<h3>Nach %s:</h3>\n"
|
||||||
|
"<ul>\n"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:128 contrib/admin/views/main.py:167
|
||||||
|
#: contrib/admin/views/main.py:187
|
||||||
|
#, python-format
|
||||||
|
msgid "<h3>By %s:</h3><ul>\n"
|
||||||
|
msgstr "<h3>Nach %s:</h3><ul>\n"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:210
|
||||||
|
#, python-format
|
||||||
|
msgid "Select %s"
|
||||||
|
msgstr "%s auswählen"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:211
|
||||||
|
#, python-format
|
||||||
|
msgid "Select %s to change"
|
||||||
|
msgstr "%s zur Änderung auswählen"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:567
|
||||||
|
#, python-format
|
||||||
|
msgid "The %(name)s \"%(obj)s\" was added successfully."
|
||||||
|
msgstr "%(name)s \"%(obj)s\" wurde erfolgreich hinzugefügt."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:572 contrib/admin/views/main.py:647
|
||||||
|
msgid "You may edit it again below."
|
||||||
|
msgstr "Das Element kann jetzt weiter geändert werden."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:580 contrib/admin/views/main.py:656
|
||||||
|
#, python-format
|
||||||
|
msgid "You may add another %s below."
|
||||||
|
msgstr "Jetzt kann ein weiteres Element vom Typ %s angelegt werden."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:597
|
||||||
|
#, python-format
|
||||||
|
msgid "Add %s"
|
||||||
|
msgstr "%s zufügen"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:612
|
||||||
|
#, python-format
|
||||||
|
msgid "Added %s."
|
||||||
|
msgstr "%s hinzugefügt."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:612 contrib/admin/views/main.py:614
|
||||||
|
#: contrib/admin/views/main.py:616
|
||||||
|
msgid "and"
|
||||||
|
msgstr "und"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:614
|
||||||
|
#, python-format
|
||||||
|
msgid "Changed %s."
|
||||||
|
msgstr "%s geändert"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:616
|
||||||
|
#, python-format
|
||||||
|
msgid "Deleted %s."
|
||||||
|
msgstr "%s gelöscht."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:619
|
||||||
|
msgid "No fields changed."
|
||||||
|
msgstr "Keine Felder geändert."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:644
|
||||||
|
#, python-format
|
||||||
|
msgid "The %(name)s \"%(obj)s\" was changed successfully."
|
||||||
|
msgstr "%(name)s \"%(obj)s\" wurde erfolgreich geändert."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:653
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"The %(name)s \"%(obj)s\" was added successfully. You may edit it again below."
|
||||||
|
msgstr ""
|
||||||
|
"%(name)s \"%(obj)s\" wurde erfolgreich zugefügt. Das Element kann jetzt "
|
||||||
|
"geändert werden."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:691
|
||||||
|
#, python-format
|
||||||
|
msgid "Change %s"
|
||||||
|
msgstr "%s ändern"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:771
|
||||||
|
#, python-format
|
||||||
|
msgid "One or more %(fieldname)s in %(name)s: %(obj)s"
|
||||||
|
msgstr "Ein oder mehrere %(fieldname)s in %(name)s: %(obj)s"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:776
|
||||||
|
#, python-format
|
||||||
|
msgid "One or more %(fieldname)s in %(name)s:"
|
||||||
|
msgstr "Ein oder mehrere %(fieldname)s in %(name)s:"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:805
|
||||||
|
#, python-format
|
||||||
|
msgid "The %(name)s \"%(obj)s\" was deleted successfully."
|
||||||
|
msgstr "%(name)s \"%(obj)s\" wurde erfolgreich gelöscht."
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:808
|
||||||
|
msgid "Are you sure?"
|
||||||
|
msgstr "Sicher? Ganz sicher?"
|
||||||
|
|
||||||
|
#: contrib/admin/views/main.py:823
|
||||||
|
#, python-format
|
||||||
|
msgid "Change history: %s"
|
||||||
|
msgstr "Änderungsgeschichte: %s"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:262 contrib/admin/views/doc.py:271
|
||||||
|
#: contrib/admin/views/doc.py:273 contrib/admin/views/doc.py:278
|
||||||
|
#: contrib/admin/views/doc.py:279 contrib/admin/views/doc.py:281
|
||||||
|
msgid "Integer"
|
||||||
|
msgstr "Ganzzahl"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:263
|
||||||
|
msgid "Boolean (Either True or False)"
|
||||||
|
msgstr "Wahrheitswert (Wahr oder Falsch)"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:264
|
||||||
|
#, python-format
|
||||||
|
msgid "String (up to %(maxlength)s)"
|
||||||
|
msgstr "Zeichenkette (bis zu %(maxlength)s Zeichen)"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:265
|
||||||
|
msgid "Comma-separated integers"
|
||||||
|
msgstr "Kommaseparierte Liste von Zahlen"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:266
|
||||||
|
msgid "Date (without time)"
|
||||||
|
msgstr "Datum (ohne Zeit)"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:267
|
||||||
|
msgid "Date (with time)"
|
||||||
|
msgstr "Datum (mit Zeit)"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:268
|
||||||
|
msgid "E-mail address"
|
||||||
|
msgstr "E-mail-Adresse"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:269 contrib/admin/views/doc.py:272
|
||||||
|
msgid "File path"
|
||||||
|
msgstr "Dateipfad"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:270
|
||||||
|
msgid "Decimal number"
|
||||||
|
msgstr "Dezimalzahl"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:274
|
||||||
|
msgid "IP address"
|
||||||
|
msgstr "IP-Adresse"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:276
|
||||||
|
msgid "Boolean (Either True, False or None)"
|
||||||
|
msgstr "Wahrheitswert (Wahr, Falsch oder Nichts)"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:277
|
||||||
|
msgid "Phone number"
|
||||||
|
msgstr "Telefonnummer"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:280
|
||||||
|
msgid "String (up to 50)"
|
||||||
|
msgstr "Zeichenkette (bis zu 50 Zeichen)"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:282
|
||||||
|
msgid "Text"
|
||||||
|
msgstr "Text"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:283
|
||||||
|
msgid "Time"
|
||||||
|
msgstr "Zeit"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:284 models/core.py:81
|
||||||
|
msgid "URL"
|
||||||
|
msgstr "URL"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:285
|
||||||
|
msgid "U.S. state (two uppercase letters)"
|
||||||
|
msgstr "U.S. Bundesstaat (zwei Grossbuchstaben)"
|
||||||
|
|
||||||
|
#: contrib/admin/views/doc.py:286
|
||||||
|
msgid "XML text"
|
||||||
|
msgstr "XML Text"
|
||||||
|
|
||||||
#: contrib/admin/templates/admin/index.html:27
|
#: contrib/admin/templates/admin/index.html:27
|
||||||
#: contrib/admin/templates/admin/change_form.html:14
|
#: contrib/admin/templates/admin/change_form.html:14
|
||||||
msgid "Add"
|
msgid "Add"
|
||||||
@ -149,10 +370,6 @@ msgstr "Passwort:"
|
|||||||
msgid "Have you <a href=\"/password_reset/\">forgotten your password</a>?"
|
msgid "Have you <a href=\"/password_reset/\">forgotten your password</a>?"
|
||||||
msgstr "Haben Sie <a href=\"/password_reset/\">ihr Passwort vergessen</a>?"
|
msgstr "Haben Sie <a href=\"/password_reset/\">ihr Passwort vergessen</a>?"
|
||||||
|
|
||||||
#: contrib/admin/templates/admin/login.html:24
|
|
||||||
msgid "Log in"
|
|
||||||
msgstr "Anmelden"
|
|
||||||
|
|
||||||
#: contrib/admin/templates/admin/404.html:4
|
#: contrib/admin/templates/admin/404.html:4
|
||||||
#: contrib/admin/templates/admin/404.html:8
|
#: contrib/admin/templates/admin/404.html:8
|
||||||
msgid "Page not found"
|
msgid "Page not found"
|
||||||
@ -217,6 +434,26 @@ msgstr "Passwort
|
|||||||
msgid "Log out"
|
msgid "Log out"
|
||||||
msgstr "Abmelden"
|
msgstr "Abmelden"
|
||||||
|
|
||||||
|
#: contrib/admin/templates/admin/submit_line.html:3
|
||||||
|
msgid "Delete"
|
||||||
|
msgstr "Löschen"
|
||||||
|
|
||||||
|
#: contrib/admin/templates/admin/submit_line.html:4
|
||||||
|
msgid "Save as new"
|
||||||
|
msgstr "Als Neu sichern"
|
||||||
|
|
||||||
|
#: contrib/admin/templates/admin/submit_line.html:5
|
||||||
|
msgid "Save and add another"
|
||||||
|
msgstr "Sichern und neu hinzufügen"
|
||||||
|
|
||||||
|
#: contrib/admin/templates/admin/submit_line.html:6
|
||||||
|
msgid "Save and continue editing"
|
||||||
|
msgstr "Sichern und weiter bearbeiten"
|
||||||
|
|
||||||
|
#: contrib/admin/templates/admin/submit_line.html:7
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Sichern"
|
||||||
|
|
||||||
#: contrib/admin/templates/registration/password_change_done.html:4
|
#: contrib/admin/templates/registration/password_change_done.html:4
|
||||||
#: contrib/admin/templates/registration/password_change_form.html:4
|
#: contrib/admin/templates/registration/password_change_form.html:4
|
||||||
#: contrib/admin/templates/registration/password_change_form.html:6
|
#: contrib/admin/templates/registration/password_change_form.html:6
|
||||||
@ -513,10 +750,6 @@ msgstr "Umleitung"
|
|||||||
msgid "redirects"
|
msgid "redirects"
|
||||||
msgstr "Umleitungen"
|
msgstr "Umleitungen"
|
||||||
|
|
||||||
#: models/core.py:81
|
|
||||||
msgid "URL"
|
|
||||||
msgstr "URL"
|
|
||||||
|
|
||||||
#: models/core.py:82
|
#: models/core.py:82
|
||||||
msgid ""
|
msgid ""
|
||||||
"Example: '/about/contact/'. Make sure to have leading and trailing slashes."
|
"Example: '/about/contact/'. Make sure to have leading and trailing slashes."
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
{% load i18n %}
|
||||||
<div class="submit-row">
|
<div class="submit-row">
|
||||||
{% if show_delete_link %}<p class="float-left"><a href="delete/" class="deletelink">Delete</a></p>{% endif %}
|
{% if show_delete_link %}<p class="float-left"><a href="delete/" class="deletelink">{% trans "Delete" %}</a></p>{% endif %}
|
||||||
{% if show_save_as_new %}<input type="submit" value="Save as new" name="_saveasnew" {{onclick_attrib}}/>{%endif%}
|
{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{onclick_attrib}}/>{%endif%}
|
||||||
{% if show_save_and_add_another %}<input type="submit" value="Save and add another" name="_addanother" {{onclick_attrib}} />{% endif %}
|
{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{onclick_attrib}} />{% endif %}
|
||||||
{% if show_save_and_continue %}<input type="submit" value="Save and continue editing" name="_continue" {{onclick_attrib}}/>{% endif %}
|
{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{onclick_attrib}}/>{% endif %}
|
||||||
{% if show_save %}<input type="submit" value="Save" class="default" {{onclick_attrib}}/>{% endif %}
|
{% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" {{onclick_attrib}}/>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -252,8 +252,8 @@ def date_hierarchy(cl):
|
|||||||
raw_template.append('<li><a href="%s">%s</a></li>' % \
|
raw_template.append('<li><a href="%s">%s</a></li>' % \
|
||||||
(cl.get_query_string({year_field: year_lookup, month_field: month_lookup, day_field: day.day}, [field_generic]), day.strftime('%B %d')))
|
(cl.get_query_string({year_field: year_lookup, month_field: month_lookup, day_field: day.day}, [field_generic]), day.strftime('%B %d')))
|
||||||
elif year_lookup:
|
elif year_lookup:
|
||||||
raw_template.append('<li class="date-back"><a href="%s">‹ All dates</a></li>' % \
|
raw_template.append('<li class="date-back"><a href="%s">‹ %s</a></li>' % \
|
||||||
cl.get_query_string( {}, [year_field]))
|
cl.get_query_string( {}, [year_field]), _('All dates'))
|
||||||
date_lookup_params = lookup_params.copy()
|
date_lookup_params = lookup_params.copy()
|
||||||
date_lookup_params.update({year_field: year_lookup})
|
date_lookup_params.update({year_field: year_lookup})
|
||||||
for month in getattr(lookup_mod, 'get_%s_list' % field_name)('month', **date_lookup_params):
|
for month in getattr(lookup_mod, 'get_%s_list' % field_name)('month', **date_lookup_params):
|
||||||
|
@ -19,7 +19,7 @@ def _display_login_form(request, error_message=''):
|
|||||||
else:
|
else:
|
||||||
post_data = _encode_post_data({})
|
post_data = _encode_post_data({})
|
||||||
return render_to_response('admin/login', {
|
return render_to_response('admin/login', {
|
||||||
'title': 'Log in',
|
'title': _('Log in'),
|
||||||
'app_path': request.path,
|
'app_path': request.path,
|
||||||
'post_data': post_data,
|
'post_data': post_data,
|
||||||
'error_message': error_message
|
'error_message': error_message
|
||||||
@ -53,15 +53,14 @@ def staff_member_required(view_func):
|
|||||||
# If this isn't already the login page, display it.
|
# If this isn't already the login page, display it.
|
||||||
if not request.POST.has_key(LOGIN_FORM_KEY):
|
if not request.POST.has_key(LOGIN_FORM_KEY):
|
||||||
if request.POST:
|
if request.POST:
|
||||||
message = "Please log in again, because your session has expired. "\
|
message = _("Please log in again, because your session has expired. Don't worry: Your submission has been saved.")
|
||||||
"Don't worry: Your submission has been saved."
|
|
||||||
else:
|
else:
|
||||||
message = ""
|
message = ""
|
||||||
return _display_login_form(request, message)
|
return _display_login_form(request, message)
|
||||||
|
|
||||||
# Check that the user accepts cookies.
|
# Check that the user accepts cookies.
|
||||||
if not request.session.test_cookie_worked():
|
if not request.session.test_cookie_worked():
|
||||||
message = "Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again."
|
message = _("Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again.")
|
||||||
return _display_login_form(request, message)
|
return _display_login_form(request, message)
|
||||||
|
|
||||||
# Check the password.
|
# Check the password.
|
||||||
@ -75,9 +74,9 @@ def staff_member_required(view_func):
|
|||||||
try:
|
try:
|
||||||
user = users.get_object(email__exact=username)
|
user = users.get_object(email__exact=username)
|
||||||
except users.UserDoesNotExist:
|
except users.UserDoesNotExist:
|
||||||
message = "Usernames cannot contain the '@' character."
|
message = _("Usernames cannot contain the '@' character.")
|
||||||
else:
|
else:
|
||||||
message = "Your e-mail address is not your username. Try '%s' instead." % user.username
|
message = _("Your e-mail address is not your username. Try '%s' instead.") % user.username
|
||||||
return _display_login_form(request, message)
|
return _display_login_form(request, message)
|
||||||
|
|
||||||
# The user data is correct; log in the user in and continue.
|
# The user data is correct; log in the user in and continue.
|
||||||
|
@ -259,31 +259,31 @@ def get_return_data_type(func_name):
|
|||||||
# against the values of Field.__dict__ before being output.
|
# against the values of Field.__dict__ before being output.
|
||||||
# If a column type is set to None, it won't be included in the output.
|
# If a column type is set to None, it won't be included in the output.
|
||||||
DATA_TYPE_MAPPING = {
|
DATA_TYPE_MAPPING = {
|
||||||
'AutoField' : 'Integer',
|
'AutoField' : _('Integer'),
|
||||||
'BooleanField' : 'Boolean (Either True or False)',
|
'BooleanField' : _('Boolean (Either True or False)'),
|
||||||
'CharField' : 'String (up to %(maxlength)s)',
|
'CharField' : _('String (up to %(maxlength)s)'),
|
||||||
'CommaSeparatedIntegerField': 'Comma-separated integers',
|
'CommaSeparatedIntegerField': _('Comma-separated integers'),
|
||||||
'DateField' : 'Date (without time)',
|
'DateField' : _('Date (without time)'),
|
||||||
'DateTimeField' : 'Date (with time)',
|
'DateTimeField' : _('Date (with time)'),
|
||||||
'EmailField' : 'E-mail address',
|
'EmailField' : _('E-mail address'),
|
||||||
'FileField' : 'File path',
|
'FileField' : _('File path'),
|
||||||
'FloatField' : 'Decimal number',
|
'FloatField' : _('Decimal number'),
|
||||||
'ForeignKey' : 'Integer',
|
'ForeignKey' : _('Integer'),
|
||||||
'ImageField' : 'File path',
|
'ImageField' : _('File path'),
|
||||||
'IntegerField' : 'Integer',
|
'IntegerField' : _('Integer'),
|
||||||
'IPAddressField' : 'IP address',
|
'IPAddressField' : _('IP address'),
|
||||||
'ManyToManyField' : '',
|
'ManyToManyField' : '',
|
||||||
'NullBooleanField' : 'Boolean (Either True, False or None)',
|
'NullBooleanField' : _('Boolean (Either True, False or None)'),
|
||||||
'PhoneNumberField' : 'Phone number',
|
'PhoneNumberField' : _('Phone number'),
|
||||||
'PositiveIntegerField' : 'Integer',
|
'PositiveIntegerField' : _('Integer'),
|
||||||
'PositiveSmallIntegerField' : 'Integer',
|
'PositiveSmallIntegerField' : _('Integer'),
|
||||||
'SlugField' : 'String (up to 50)',
|
'SlugField' : _('String (up to 50)'),
|
||||||
'SmallIntegerField' : 'Integer',
|
'SmallIntegerField' : _('Integer'),
|
||||||
'TextField' : 'Text',
|
'TextField' : _('Text'),
|
||||||
'TimeField' : 'Time',
|
'TimeField' : _('Time'),
|
||||||
'URLField' : 'URL',
|
'URLField' : _('URL'),
|
||||||
'USStateField' : 'U.S. state (two uppercase letters)',
|
'USStateField' : _('U.S. state (two uppercase letters)'),
|
||||||
'XMLField' : 'XML text',
|
'XMLField' : _('XML text'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_readable_field_data_type(field):
|
def get_readable_field_data_type(field):
|
||||||
|
@ -75,7 +75,7 @@ class FilterSpec(object):
|
|||||||
def output(self, cl):
|
def output(self, cl):
|
||||||
t = []
|
t = []
|
||||||
if self.has_output():
|
if self.has_output():
|
||||||
t.append('<h3>By %s:</h3>\n<ul>\n' % self.title)
|
t.append(_('<h3>By %s:</h3>\n<ul>\n') % self.title)
|
||||||
|
|
||||||
for choice in self.choices:
|
for choice in self.choices:
|
||||||
t.append('<li%s><a href="%s">%s</a></li>\n' % \
|
t.append('<li%s><a href="%s">%s</a></li>\n' % \
|
||||||
@ -103,7 +103,7 @@ class RelatedFilterSpec(FilterSpec):
|
|||||||
def output(self, cl):
|
def output(self, cl):
|
||||||
t = []
|
t = []
|
||||||
if self.has_output():
|
if self.has_output():
|
||||||
t.append('<h3>By %s:</h3>\n<ul>\n' % self.lookup_title)
|
t.append(_('<h3>By %s:</h3>\n<ul>\n') % self.lookup_title)
|
||||||
t.append('<li%s><a href="%s">All</a></li>\n' % \
|
t.append('<li%s><a href="%s">All</a></li>\n' % \
|
||||||
((self.lookup_val is None and ' class="selected"' or ''),
|
((self.lookup_val is None and ' class="selected"' or ''),
|
||||||
cl.get_query_string({}, [self.lookup_kwarg])))
|
cl.get_query_string({}, [self.lookup_kwarg])))
|
||||||
@ -125,7 +125,7 @@ class ChoicesFilterSpec(FilterSpec):
|
|||||||
|
|
||||||
def output(self, cl):
|
def output(self, cl):
|
||||||
t = []
|
t = []
|
||||||
t.append('<h3>By %s:</h3><ul>\n' % self.field.verbose_name)
|
t.append(_('<h3>By %s:</h3><ul>\n') % self.field.verbose_name)
|
||||||
t.append('<li%s><a href="%s">All</a></li>\n' % \
|
t.append('<li%s><a href="%s">All</a></li>\n' % \
|
||||||
((self.lookup_val is None and ' class="selected"' or ''),
|
((self.lookup_val is None and ' class="selected"' or ''),
|
||||||
cl.get_query_string( {}, [self.lookup_kwarg])))
|
cl.get_query_string( {}, [self.lookup_kwarg])))
|
||||||
@ -164,7 +164,7 @@ class DateFieldFilterSpec(FilterSpec):
|
|||||||
|
|
||||||
def output(self, cl):
|
def output(self, cl):
|
||||||
t = []
|
t = []
|
||||||
t.append('<h3>By %s:</h3><ul>\n' % self.field.verbose_name)
|
t.append(_('<h3>By %s:</h3><ul>\n') % self.field.verbose_name)
|
||||||
for title, param_dict in self.links:
|
for title, param_dict in self.links:
|
||||||
t.append('<li%s><a href="%s">%s</a></li>\n' % \
|
t.append('<li%s><a href="%s">%s</a></li>\n' % \
|
||||||
((self.date_params == param_dict) and ' class="selected"' or '',
|
((self.date_params == param_dict) and ' class="selected"' or '',
|
||||||
@ -184,7 +184,7 @@ class BooleanFieldFilterSpec(FilterSpec):
|
|||||||
|
|
||||||
def output(self, cl):
|
def output(self, cl):
|
||||||
t = []
|
t = []
|
||||||
t.append('<h3>By %s:</h3><ul>\n' % self.field.verbose_name)
|
t.append(_('<h3>By %s:</h3><ul>\n') % self.field.verbose_name)
|
||||||
for k, v in (('All', None), ('Yes', '1'), ('No', '0')):
|
for k, v in (('All', None), ('Yes', '1'), ('No', '0')):
|
||||||
t.append('<li%s><a href="%s">%s</a></li>\n' % \
|
t.append('<li%s><a href="%s">%s</a></li>\n' % \
|
||||||
(((self.lookup_val == v and not self.lookup_val2) and ' class="selected"' or ''),
|
(((self.lookup_val == v and not self.lookup_val2) and ' class="selected"' or ''),
|
||||||
@ -207,8 +207,8 @@ class ChangeList(object):
|
|||||||
self.get_lookup_params()
|
self.get_lookup_params()
|
||||||
self.get_results(request)
|
self.get_results(request)
|
||||||
self.title = (self.is_popup
|
self.title = (self.is_popup
|
||||||
and 'Select %s' % self.opts.verbose_name
|
and _('Select %s') % self.opts.verbose_name
|
||||||
or 'Select %s to change' % self.opts.verbose_name)
|
or _('Select %s to change') % self.opts.verbose_name)
|
||||||
self.get_filters(request)
|
self.get_filters(request)
|
||||||
|
|
||||||
def get_filters(self, request):
|
def get_filters(self, request):
|
||||||
@ -564,12 +564,12 @@ def add_stage(request, app_label, module_name, show_delete=False, form_url='', p
|
|||||||
if not errors and not request.POST.has_key("_preview"):
|
if not errors and not request.POST.has_key("_preview"):
|
||||||
new_object = manipulator.save(new_data)
|
new_object = manipulator.save(new_data)
|
||||||
log_add_message(request.user, opts,manipulator,new_object)
|
log_add_message(request.user, opts,manipulator,new_object)
|
||||||
msg = 'The %s "%s" was added successfully.' % (opts.verbose_name, new_object)
|
msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name':opts.verbose_name, 'obj':new_object}
|
||||||
pk_value = getattr(new_object,opts.pk.column)
|
pk_value = getattr(new_object,opts.pk.column)
|
||||||
# Here, we distinguish between different save types by checking for
|
# Here, we distinguish between different save types by checking for
|
||||||
# the presence of keys in request.POST.
|
# the presence of keys in request.POST.
|
||||||
if request.POST.has_key("_continue"):
|
if request.POST.has_key("_continue"):
|
||||||
request.user.add_message("%s You may edit it again below." % msg)
|
request.user.add_message(msg + ' ' + _("You may edit it again below."))
|
||||||
if request.POST.has_key("_popup"):
|
if request.POST.has_key("_popup"):
|
||||||
post_url_continue += "?_popup=1"
|
post_url_continue += "?_popup=1"
|
||||||
return HttpResponseRedirect(post_url_continue % pk_value)
|
return HttpResponseRedirect(post_url_continue % pk_value)
|
||||||
@ -577,7 +577,7 @@ def add_stage(request, app_label, module_name, show_delete=False, form_url='', p
|
|||||||
return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \
|
return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \
|
||||||
(pk_value, repr(new_object).replace('"', '\\"')))
|
(pk_value, repr(new_object).replace('"', '\\"')))
|
||||||
elif request.POST.has_key("_addanother"):
|
elif request.POST.has_key("_addanother"):
|
||||||
request.user.add_message("%s You may add another %s below." % (msg, opts.verbose_name))
|
request.user.add_message(msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))
|
||||||
return HttpResponseRedirect(request.path)
|
return HttpResponseRedirect(request.path)
|
||||||
else:
|
else:
|
||||||
request.user.add_message(msg)
|
request.user.add_message(msg)
|
||||||
@ -594,7 +594,7 @@ def add_stage(request, app_label, module_name, show_delete=False, form_url='', p
|
|||||||
form = formfields.FormWrapper(manipulator, new_data, errors, edit_inline=True)
|
form = formfields.FormWrapper(manipulator, new_data, errors, edit_inline=True)
|
||||||
|
|
||||||
c = Context(request, {
|
c = Context(request, {
|
||||||
'title': 'Add %s' % opts.verbose_name,
|
'title': _('Add %s') % opts.verbose_name,
|
||||||
'form': form,
|
'form': form,
|
||||||
'is_popup': request.REQUEST.has_key('_popup'),
|
'is_popup': request.REQUEST.has_key('_popup'),
|
||||||
})
|
})
|
||||||
@ -609,14 +609,14 @@ def log_change_message(user, opts,manipulator,new_object):
|
|||||||
# Construct the change message.
|
# Construct the change message.
|
||||||
change_message = []
|
change_message = []
|
||||||
if manipulator.fields_added:
|
if manipulator.fields_added:
|
||||||
change_message.append('Added %s.' % get_text_list(manipulator.fields_added, 'and'))
|
change_message.append(_('Added %s.') % get_text_list(manipulator.fields_added, _('and')))
|
||||||
if manipulator.fields_changed:
|
if manipulator.fields_changed:
|
||||||
change_message.append('Changed %s.' % get_text_list(manipulator.fields_changed, 'and'))
|
change_message.append(_('Changed %s.') % get_text_list(manipulator.fields_changed, _('and')))
|
||||||
if manipulator.fields_deleted:
|
if manipulator.fields_deleted:
|
||||||
change_message.append('Deleted %s.' % get_text_list(manipulator.fields_deleted, 'and'))
|
change_message.append(_('Deleted %s.') % get_text_list(manipulator.fields_deleted, _('and')))
|
||||||
change_message = ' '.join(change_message)
|
change_message = ' '.join(change_message)
|
||||||
if not change_message:
|
if not change_message:
|
||||||
change_message = 'No fields changed.'
|
change_message = _('No fields changed.')
|
||||||
log.log_action(user.id, opts.get_content_type_id(), pk_value, str(new_object), log.CHANGE, change_message)
|
log.log_action(user.id, opts.get_content_type_id(), pk_value, str(new_object), log.CHANGE, change_message)
|
||||||
|
|
||||||
def change_stage(request, app_label, module_name, object_id):
|
def change_stage(request, app_label, module_name, object_id):
|
||||||
@ -641,19 +641,19 @@ def change_stage(request, app_label, module_name, object_id):
|
|||||||
if not errors and not request.POST.has_key("_preview"):
|
if not errors and not request.POST.has_key("_preview"):
|
||||||
new_object = manipulator.save(new_data)
|
new_object = manipulator.save(new_data)
|
||||||
log_change_message(request.user,opts,manipulator,new_object)
|
log_change_message(request.user,opts,manipulator,new_object)
|
||||||
msg = 'The %s "%s" was changed successfully.' % (opts.verbose_name, new_object)
|
msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': opts.verbose_name, 'obj':new_object}
|
||||||
pk_value = getattr(new_object,opts.pk.column)
|
pk_value = getattr(new_object,opts.pk.column)
|
||||||
if request.POST.has_key("_continue"):
|
if request.POST.has_key("_continue"):
|
||||||
request.user.add_message("%s You may edit it again below." % msg)
|
request.user.add_message(msg + ' ' + _("You may edit it again below."))
|
||||||
if request.REQUEST.has_key('_popup'):
|
if request.REQUEST.has_key('_popup'):
|
||||||
return HttpResponseRedirect(request.path + "?_popup=1")
|
return HttpResponseRedirect(request.path + "?_popup=1")
|
||||||
else:
|
else:
|
||||||
return HttpResponseRedirect(request.path)
|
return HttpResponseRedirect(request.path)
|
||||||
elif request.POST.has_key("_saveasnew"):
|
elif request.POST.has_key("_saveasnew"):
|
||||||
request.user.add_message('The %s "%s" was added successfully. You may edit it again below.' % (opts.verbose_name, new_object))
|
request.user.add_message(_('The %(name)s "%(obj)s" was added successfully. You may edit it again below.') % {'name': opts.verbose_name, 'obj': new_object})
|
||||||
return HttpResponseRedirect("../%s/" % pk_value)
|
return HttpResponseRedirect("../%s/" % pk_value)
|
||||||
elif request.POST.has_key("_addanother"):
|
elif request.POST.has_key("_addanother"):
|
||||||
request.user.add_message("%s You may add another %s below." % (msg, opts.verbose_name))
|
request.user.add_message(msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))
|
||||||
return HttpResponseRedirect("../add/")
|
return HttpResponseRedirect("../add/")
|
||||||
else:
|
else:
|
||||||
request.user.add_message(msg)
|
request.user.add_message(msg)
|
||||||
@ -688,7 +688,7 @@ def change_stage(request, app_label, module_name, object_id):
|
|||||||
form.order_objects.extend(orig_list)
|
form.order_objects.extend(orig_list)
|
||||||
|
|
||||||
c = Context(request, {
|
c = Context(request, {
|
||||||
'title': 'Change %s' % opts.verbose_name,
|
'title': _('Change %s') % opts.verbose_name,
|
||||||
'form': form,
|
'form': form,
|
||||||
'object_id': object_id,
|
'object_id': object_id,
|
||||||
'original': manipulator.original_object,
|
'original': manipulator.original_object,
|
||||||
@ -768,12 +768,14 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current
|
|||||||
if related.field.rel.edit_inline or not related.opts.admin:
|
if related.field.rel.edit_inline or not related.opts.admin:
|
||||||
# Don't display link to edit, because it either has no
|
# Don't display link to edit, because it either has no
|
||||||
# admin or is edited inline.
|
# admin or is edited inline.
|
||||||
nh(deleted_objects, current_depth, ['One or more %s in %s: %s' % \
|
nh(deleted_objects, current_depth, [_('One or more %(fieldname)s in %(name)s: %(obj)s') % \
|
||||||
(related.field.name, related.opts.verbose_name, strip_tags(str(sub_obj))), []])
|
{'fieldname': related.field.name, 'name': related.opts.verbose_name, 'obj': strip_tags(str(sub_obj))}, []])
|
||||||
else:
|
else:
|
||||||
# Display a link to the admin page.
|
# Display a link to the admin page.
|
||||||
nh(deleted_objects, current_depth, ['One or more %s in %s: <a href="../../../../%s/%s/%s/">%s</a>' % \
|
nh(deleted_objects, current_depth, [
|
||||||
(related.field.name, related.opts.verbose_name, related.opts.app_label, related.opts.module_name, sub_obj.id, strip_tags(str(sub_obj))), []])
|
(_('One or more %(fieldname)s in %(name)s:') % {'fieldname': related.field.name, 'name':related.opts.verbose_name}) + \
|
||||||
|
(' <a href="../../../../%s/%s/%s/">%s</a>' % \
|
||||||
|
(related.opts.app_label, related.opts.module_name, sub_obj.id, strip_tags(str(sub_obj)))), []])
|
||||||
# If there were related objects, and the user doesn't have
|
# If there were related objects, and the user doesn't have
|
||||||
# permission to change them, add the missing perm to perms_needed.
|
# permission to change them, add the missing perm to perms_needed.
|
||||||
if related.opts.admin and has_related_objs:
|
if related.opts.admin and has_related_objs:
|
||||||
@ -800,10 +802,10 @@ def delete_stage(request, app_label, module_name, object_id):
|
|||||||
obj_display = str(obj)
|
obj_display = str(obj)
|
||||||
obj.delete()
|
obj.delete()
|
||||||
log.log_action(request.user.id, opts.get_content_type_id(), object_id, obj_display, log.DELETION)
|
log.log_action(request.user.id, opts.get_content_type_id(), object_id, obj_display, log.DELETION)
|
||||||
request.user.add_message('The %s "%s" was deleted successfully.' % (opts.verbose_name, obj_display))
|
request.user.add_message(_('The %(name)s "%(obj)s" was deleted successfully.') % {'name':opts.verbose_name, 'obj':obj_display})
|
||||||
return HttpResponseRedirect("../../")
|
return HttpResponseRedirect("../../")
|
||||||
return render_to_response('admin/delete_confirmation', {
|
return render_to_response('admin/delete_confirmation', {
|
||||||
"title": "Are you sure?",
|
"title": _("Are you sure?"),
|
||||||
"object_name": opts.verbose_name,
|
"object_name": opts.verbose_name,
|
||||||
"object": obj,
|
"object": obj,
|
||||||
"deleted_objects": deleted_objects,
|
"deleted_objects": deleted_objects,
|
||||||
@ -818,7 +820,7 @@ def history(request, app_label, module_name, object_id):
|
|||||||
# If no history was found, see whether this object even exists.
|
# If no history was found, see whether this object even exists.
|
||||||
obj = get_object_or_404(mod, pk=object_id)
|
obj = get_object_or_404(mod, pk=object_id)
|
||||||
return render_to_response('admin/object_history', {
|
return render_to_response('admin/object_history', {
|
||||||
'title': 'Change history: %s' % obj,
|
'title': _('Change history: %s') % obj,
|
||||||
'action_list': action_list,
|
'action_list': action_list,
|
||||||
'module_name': capfirst(opts.verbose_name_plural),
|
'module_name': capfirst(opts.verbose_name_plural),
|
||||||
'object': obj,
|
'object': obj,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user