From 665b9c420aa1a7c768e44a8639b6fc185823e202 Mon Sep 17 00:00:00 2001 From: Aditi Mittal 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 +- mediagoblin/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 5484c178..33e1f45c 100644 --- a/mediagoblin/auth/forms.py +++ b/mediagoblin/auth/forms.py @@ -17,7 +17,7 @@ import wtforms from mediagoblin.tools.mail import normalize_email -from mediagoblin.tools.translate import fake_ugettext_passthrough as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ def normalize_user_or_email_field(allow_email=True, allow_user=True): """Check if we were passed a field that matches a username and/or email pattern diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index dc408911..627df177 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -20,7 +20,7 @@ import datetime from mediagoblin import messages, mg_globals from mediagoblin.db.models import User from mediagoblin.tools.response import render_to_response, redirect, render_404 -from mediagoblin.tools.translate import pass_to_ugettext as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.auth import lib as auth_lib from mediagoblin.auth import forms as auth_forms from mediagoblin.auth.lib import send_verification_email, \ diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index 2673967b..ef270237 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -17,7 +17,7 @@ import wtforms from mediagoblin.tools.text import tag_length_validator, TOO_LONG_TAG_WARNING -from mediagoblin.tools.translate import fake_ugettext_passthrough as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.tools.licenses import licenses_as_choices class EditForm(wtforms.Form): diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 34b7aaca..b0d8dd5d 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -29,7 +29,7 @@ from mediagoblin.decorators import (require_active_login, active_user_from_url, get_media_entry_by_id, user_may_alter_collection, get_user_collection) from mediagoblin.tools.response import render_to_response, redirect -from mediagoblin.tools.translate import pass_to_ugettext as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.tools.text import ( convert_to_tag_list_of_dicts, media_tags_as_string) from mediagoblin.tools.url import slugify diff --git a/mediagoblin/gmg_commands/theme.py b/mediagoblin/gmg_commands/theme.py index 71abb982..95b9425c 100644 --- a/mediagoblin/gmg_commands/theme.py +++ b/mediagoblin/gmg_commands/theme.py @@ -18,7 +18,7 @@ import os from mediagoblin.init import setup_global_and_app_config from mediagoblin.tools.theme import register_themes -from mediagoblin.tools.translate import pass_to_ugettext as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.tools.common import simple_printer diff --git a/mediagoblin/plugins/oauth/forms.py b/mediagoblin/plugins/oauth/forms.py index d0a4e9b8..5edd992a 100644 --- a/mediagoblin/plugins/oauth/forms.py +++ b/mediagoblin/plugins/oauth/forms.py @@ -19,7 +19,7 @@ import wtforms from urlparse import urlparse from mediagoblin.tools.extlib.wtf_html5 import URLField -from mediagoblin.tools.translate import fake_ugettext_passthrough as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ class AuthorizationForm(wtforms.Form): diff --git a/mediagoblin/submit/forms.py b/mediagoblin/submit/forms.py index bd1e904f..e9bd93fd 100644 --- a/mediagoblin/submit/forms.py +++ b/mediagoblin/submit/forms.py @@ -18,7 +18,7 @@ import wtforms from mediagoblin.tools.text import tag_length_validator -from mediagoblin.tools.translate import fake_ugettext_passthrough as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.tools.licenses import licenses_as_choices diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index 9d31c844..1a7c0ced 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -24,7 +24,7 @@ _log = logging.getLogger(__name__) from mediagoblin.tools.text import convert_to_tag_list_of_dicts -from mediagoblin.tools.translate import pass_to_ugettext as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.tools.response import render_to_response, redirect from mediagoblin.decorators import require_active_login from mediagoblin.submit import forms as submit_forms diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index 35b4aa04..be6976c2 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -19,7 +19,7 @@ {# Render the label for a field #} {% macro render_label(field) %} {%- if field.label.text -%} - + {%- endif -%} {%- endmacro %} @@ -39,11 +39,11 @@ {{ field }} {%- if field.errors -%} {% for error in field.errors %} -

{{ _(error) }}

+

{{ error }}

{% endfor %} {%- endif %} {%- if field.description %} -

{{ _(field.description)|safe }}

+

{{ field.description|safe }}

{%- endif %} {%- endmacro %} @@ -59,7 +59,7 @@ {% macro render_table(form) -%} {% for field in form %} - {{ _(field.label.text) }} + {{ field.label.text }} {{field}} {% if field.errors %} diff --git a/mediagoblin/tools/exif.py b/mediagoblin/tools/exif.py index d0f9d0a6..ced9ee8e 100644 --- a/mediagoblin/tools/exif.py +++ b/mediagoblin/tools/exif.py @@ -20,7 +20,7 @@ except ImportError: from mediagoblin.tools.extlib.EXIF import process_file, Ratio from mediagoblin.processing import BadMediaFail -from mediagoblin.tools.translate import pass_to_ugettext as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ # A list of tags that should be stored for faster access USEFUL_TAGS = [ diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index e9746a6c..9a193680 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -16,7 +16,7 @@ import wtforms from wtforms.ext.sqlalchemy.fields import QuerySelectField -from mediagoblin.tools.translate import fake_ugettext_passthrough as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ class MediaCommentForm(wtforms.Form): comment_content = wtforms.TextAreaField( diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index e3b46c0f..f526656f 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -21,7 +21,7 @@ from mediagoblin import messages, mg_globals from mediagoblin.db.models import (MediaEntry, MediaTag, Collection, CollectionItem, User) from mediagoblin.tools.response import render_to_response, render_404, redirect -from mediagoblin.tools.translate import pass_to_ugettext as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ from mediagoblin.tools.pagination import Pagination from mediagoblin.user_pages import forms as user_forms from mediagoblin.user_pages.lib import (send_comment_email, -- 2.25.1