Ticket #667: 0001-Fix-bug-667-Use-lazy_pass_to_ugettext-for-forms.patch

File 0001-Fix-bug-667-Use-lazy_pass_to_ugettext-for-forms.patch, 8.4 KB (added by aditi, 11 years ago)

updated patch

  • mediagoblin/auth/forms.py

    From 6fb0c02661dfc21e86dbfe30e8d6b7c9de1fd760 Mon Sep 17 00:00:00 2001
    From: Aditi Mittal <aditi.iitr@gmail.com>
    Date: Mon, 22 Apr 2013 19:18:45 +0530
    Subject: [PATCH] Fix-bug-667-Use-lazy_pass_to_ugettext-for-forms.
    
    ---
     mediagoblin/auth/forms.py                          |    2 +-
     mediagoblin/auth/views.py                          |    2 +-
     mediagoblin/edit/forms.py                          |    2 +-
     mediagoblin/edit/views.py                          |    2 +-
     mediagoblin/gmg_commands/theme.py                  |    2 +-
     mediagoblin/plugins/oauth/forms.py                 |    2 +-
     mediagoblin/submit/forms.py                        |    2 +-
     mediagoblin/submit/views.py                        |    2 +-
     .../templates/mediagoblin/utils/wtforms.html       |    8 ++++----
     mediagoblin/tools/exif.py                          |    2 +-
     mediagoblin/user_pages/forms.py                    |    2 +-
     mediagoblin/user_pages/views.py                    |    2 +-
     12 files changed, 15 insertions(+), 15 deletions(-)
    
    diff --git a/mediagoblin/auth/forms.py b/mediagoblin/auth/forms.py
    index 8f091d2..90c0d41 100644
    a b  
    1717import wtforms
    1818
    1919from mediagoblin.tools.mail import normalize_email
    20 from mediagoblin.tools.translate import fake_ugettext_passthrough as _
     20from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2121
    2222def normalize_user_or_email_field(allow_email=True, allow_user=True):
    2323    """Check if we were passed a field that matches a username and/or email pattern
  • mediagoblin/auth/views.py

    diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
    index 354b48c..6b155f0 100644
    a b import datetime  
    2020from mediagoblin import messages, mg_globals
    2121from mediagoblin.db.models import User
    2222from mediagoblin.tools.response import render_to_response, redirect, render_404
    23 from mediagoblin.tools.translate import pass_to_ugettext as _
     23from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2424from mediagoblin.auth import lib as auth_lib
    2525from mediagoblin.auth import forms as auth_forms
    2626from mediagoblin.auth.lib import send_verification_email, \
  • mediagoblin/edit/forms.py

    diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py
    index 2673967..ef27023 100644
    a b  
    1717import wtforms
    1818
    1919from mediagoblin.tools.text import tag_length_validator, TOO_LONG_TAG_WARNING
    20 from mediagoblin.tools.translate import fake_ugettext_passthrough as _
     20from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2121from mediagoblin.tools.licenses import licenses_as_choices
    2222
    2323class EditForm(wtforms.Form):
  • mediagoblin/edit/views.py

    diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
    index 34b7aac..b0d8dd5 100644
    a b from mediagoblin.decorators import (require_active_login, active_user_from_url,  
    2929     get_media_entry_by_id,
    3030     user_may_alter_collection, get_user_collection)
    3131from mediagoblin.tools.response import render_to_response, redirect
    32 from mediagoblin.tools.translate import pass_to_ugettext as _
     32from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    3333from mediagoblin.tools.text import (
    3434    convert_to_tag_list_of_dicts, media_tags_as_string)
    3535from mediagoblin.tools.url import slugify
  • mediagoblin/gmg_commands/theme.py

    diff --git a/mediagoblin/gmg_commands/theme.py b/mediagoblin/gmg_commands/theme.py
    index 71abb98..95b9425 100644
    a b import os  
    1818
    1919from mediagoblin.init import setup_global_and_app_config
    2020from mediagoblin.tools.theme import register_themes
    21 from mediagoblin.tools.translate import pass_to_ugettext as _
     21from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2222from mediagoblin.tools.common import simple_printer
    2323
    2424
  • mediagoblin/plugins/oauth/forms.py

    diff --git a/mediagoblin/plugins/oauth/forms.py b/mediagoblin/plugins/oauth/forms.py
    index d0a4e9b..5edd992 100644
    a b import wtforms  
    1919from urlparse import urlparse
    2020
    2121from mediagoblin.tools.extlib.wtf_html5 import URLField
    22 from mediagoblin.tools.translate import fake_ugettext_passthrough as _
     22from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2323
    2424
    2525class AuthorizationForm(wtforms.Form):
  • mediagoblin/submit/forms.py

    diff --git a/mediagoblin/submit/forms.py b/mediagoblin/submit/forms.py
    index bd1e904..e9bd93f 100644
    a b  
    1818import wtforms
    1919
    2020from mediagoblin.tools.text import tag_length_validator
    21 from mediagoblin.tools.translate import fake_ugettext_passthrough as _
     21from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2222from mediagoblin.tools.licenses import licenses_as_choices
    2323
    2424
  • mediagoblin/submit/views.py

    diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py
    index 9d31c84..1a7c0ce 100644
    a b _log = logging.getLogger(__name__)  
    2424
    2525
    2626from mediagoblin.tools.text import convert_to_tag_list_of_dicts
    27 from mediagoblin.tools.translate import pass_to_ugettext as _
     27from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2828from mediagoblin.tools.response import render_to_response, redirect
    2929from mediagoblin.decorators import require_active_login
    3030from mediagoblin.submit import forms as submit_forms
  • mediagoblin/templates/mediagoblin/utils/wtforms.html

    diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html
    index 35b4aa0..be6976c 100644
    a b  
    1919{# Render the label for a field #}
    2020{% macro render_label(field) %}
    2121  {%- if field.label.text -%}
    22     <label for="{{ field.label.field_id }}">{{ _(field.label.text) }}</label>
     22    <label for="{{ field.label.field_id }}">{{ field.label.text }}</label>
    2323  {%- endif -%}
    2424{%- endmacro %}
    2525
     
    3939    {{ field }}
    4040    {%- if field.errors -%}
    4141      {% for error in field.errors %}
    42         <p class="form_field_error">{{ _(error) }}</p>
     42        <p class="form_field_error">{{ error }}</p>
    4343      {% endfor %}
    4444    {%- endif %}
    4545    {%- if field.description %}
    46       <p class="form_field_description">{{ _(field.description)|safe }}</p>
     46      <p class="form_field_description">{{ field.description|safe }}</p>
    4747    {%- endif %}
    4848  </div>
    4949{%- endmacro %}
     
    5959{% macro render_table(form) -%}
    6060  {% for field in form %}
    6161    <tr>
    62       <th>{{ _(field.label.text) }}</th>
     62      <th>{{ field.label.text }}</th>
    6363      <td>
    6464        {{field}}
    6565        {% if field.errors %}
  • mediagoblin/tools/exif.py

    diff --git a/mediagoblin/tools/exif.py b/mediagoblin/tools/exif.py
    index d0f9d0a..ced9ee8 100644
    a b except ImportError:  
    2020    from mediagoblin.tools.extlib.EXIF import process_file, Ratio
    2121
    2222from mediagoblin.processing import BadMediaFail
    23 from mediagoblin.tools.translate import pass_to_ugettext as _
     23from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2424
    2525# A list of tags that should be stored for faster access
    2626USEFUL_TAGS = [
  • mediagoblin/user_pages/forms.py

    diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py
    index e9746a6..9a19368 100644
    a b  
    1616
    1717import wtforms
    1818from wtforms.ext.sqlalchemy.fields import QuerySelectField
    19 from mediagoblin.tools.translate import fake_ugettext_passthrough as _
     19from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2020
    2121class MediaCommentForm(wtforms.Form):
    2222    comment_content = wtforms.TextAreaField(
  • mediagoblin/user_pages/views.py

    diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
    index 61c23f1..5510f88 100644
    a b from mediagoblin import messages, mg_globals  
    2121from mediagoblin.db.models import (MediaEntry, MediaTag, Collection,
    2222                                   CollectionItem, User)
    2323from mediagoblin.tools.response import render_to_response, render_404, redirect
    24 from mediagoblin.tools.translate import pass_to_ugettext as _
     24from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
    2525from mediagoblin.tools.pagination import Pagination
    2626from mediagoblin.user_pages import forms as user_forms
    2727from mediagoblin.user_pages.lib import send_comment_email