Make it so that form fields and descriptions are actually translated
authorChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 10 Aug 2011 15:50:42 +0000 (10:50 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 10 Aug 2011 15:50:42 +0000 (10:50 -0500)
mediagoblin/templates/mediagoblin/utils/wtforms.html

index 1d2f86199cf1345f2ebfd97dd1069aaafc071d5d..e3d8e137d51adc025405abd5b8dddd0925fdb1b5 100644 (file)
@@ -19,9 +19,9 @@
 {# Generically render a field #}
 {% macro render_field_div(field) %}
   <div class="form_field_box">
-    <div class="form_field_label">{{ field.label }}</div>
+    <div class="form_field_label">{{ _(field.label.text) }}</div>
     {% if field.description -%}
-      <div class="form_field_description">{{ field.description }}</div>
+      <div class="form_field_description">{{ _(field.description) }}</div>
     {%- endif %}
     <div class="form_field_input">{{ field }}</div>
     {%- if field.errors -%}
@@ -38,9 +38,9 @@
  # ... mostly the same thing except it includes rows and cols #}
 {% macro render_textarea_div(field, rows=8, cols=20) %}
   <div class="form_field_box">
-    <div class="form_field_label">{{ field.label }}</div>
+    <div class="form_field_label">{{ _(field.label.text) }}</div>
     {% if field.description -%}
-      <div class="form_field_description">{{ field.description }}</div>
+      <div class="form_field_description">{{ _(field.description) }}</div>
     {%- endif %}
     <div class="form_field_input">{{ field(rows=rows, cols=cols) }}</div>
     {%- if field.errors -%}
@@ -64,7 +64,7 @@
 {% macro render_table(form) -%}
   {% for field in form %}
     <tr>
-      <th>{{field.label}}</th>
+      <th>{{ _(field.label.text) }}</th>
       <td>
         {{field}}
         {% if field.errors %}