Ticket #20582: 20582-1.diff

File 20582-1.diff, 3.4 KB (added by Claude Paroz, 11 years ago)
  • django/conf/locale/en/LC_MESSAGES/django.po

    diff --git a/django/conf/locale/en/LC_MESSAGES/django.po b/django/conf/locale/en/LC_MESSAGES/django.po
    index 371f0af..f8069f0 100644
    a b msgid ""  
    44msgstr ""
    55"Project-Id-Version: Django\n"
    66"Report-Msgid-Bugs-To: \n"
    7 "POT-Creation-Date: 2013-05-25 14:27+0200\n"
     7"POT-Creation-Date: 2013-06-11 18:44+0200\n"
    88"PO-Revision-Date: 2010-05-13 15:35+0200\n"
    99"Last-Translator: Django team\n"
    1010"Language-Team: English <en@li.org>\n"
    msgstr ""  
    699699msgid "Enter a list of values."
    700700msgstr ""
    701701
    702 #: forms/forms.py:158
     702#. Translators: This is the default suffix added to form field labels
     703#: forms/forms.py:90
     704msgid ":"
     705msgstr ""
     706
     707#: forms/forms.py:159
    703708#, python-format
    704709msgid "(Hidden field %(name)s) %(error)s"
    705710msgstr ""
    706711
     712#. Translators: If found as last label character, these punctuation
     713#. characters will prevent the default label_suffix to be appended to the label
     714#: forms/forms.py:525
     715msgid ":?.!"
     716msgstr ""
     717
    707718#: forms/formsets.py:310
    708719#, python-format
    709720msgid "Please submit %d or fewer forms."
  • django/forms/forms.py

    diff --git a/django/forms/forms.py b/django/forms/forms.py
    index e6a11f2..0bc45b7 100644
    a b class BaseForm(object):  
    7777    # information. Any improvements to the form API should be made to *this*
    7878    # class, not to the Form class.
    7979    def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
    80                  initial=None, error_class=ErrorList, label_suffix=':',
     80                 initial=None, error_class=ErrorList, label_suffix=None,
    8181                 empty_permitted=False):
    8282        self.is_bound = data is not None or files is not None
    8383        self.data = data or {}
    class BaseForm(object):  
    8686        self.prefix = prefix
    8787        self.initial = initial or {}
    8888        self.error_class = error_class
    89         self.label_suffix = label_suffix
     89        # Translators: This is the default suffix added to form field labels
     90        self.label_suffix = label_suffix if label_suffix is not None else _(':')
    9091        self.empty_permitted = empty_permitted
    9192        self._errors = None # Stores the errors after clean() has been called.
    9293        self._changed_data = None
    class BoundField(object):  
    519520        contents = contents or self.label
    520521        # Only add the suffix if the label does not end in punctuation.
    521522        if self.form.label_suffix:
    522             if contents[-1] not in ':?.!':
     523            # Translators: If found as last label character, these punctuation
     524            # characters will prevent the default label_suffix to be appended to the label
     525            if contents[-1] not in _(':?.!'):
    523526                contents = format_html('{0}{1}', contents, self.form.label_suffix)
    524527        widget = self.field.widget
    525528        id_ = widget.attrs.get('id') or self.auto_id
  • django/forms/models.py

    diff --git a/django/forms/models.py b/django/forms/models.py
    index 65434a6..71b2235 100644
    a b class ModelFormMetaclass(type):  
    270270
    271271class BaseModelForm(BaseForm):
    272272    def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
    273                  initial=None, error_class=ErrorList, label_suffix=':',
     273                 initial=None, error_class=ErrorList, label_suffix=None,
    274274                 empty_permitted=False, instance=None):
    275275        opts = self._meta
    276276        if opts.model is None:
Back to Top