Fix translations around.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 3 Dec 2012 13:19:28 +0000 (14:19 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 3 Dec 2012 15:52:35 +0000 (16:52 +0100)
This includes:
- Mark more strings for translation
- Don't mark html-only nonsense for translation
- Mark a better part for translation.

mediagoblin/edit/views.py
mediagoblin/templates/mediagoblin/base.html
mediagoblin/templates/mediagoblin/edit/attachments.html
mediagoblin/templates/mediagoblin/utils/collection_gallery.html

index 2d42ff0b03e36282744d279d98325e9ae9208dc2..111f9ae8967fcb857221b1c97cf056710d78c4f6 100644 (file)
@@ -153,7 +153,7 @@ def edit_attachments(request, media):
 
             messages.add_message(
                 request, messages.SUCCESS,
-                "You added the attachment %s!" \
+                _("You added the attachment %s!") \
                     % (request.form['attachment_name']
                        or request.files['attachment_file'].filename))
 
index bd3467cbac3020e2fd12823b55ecb623febfcfd3..745bb6f913d311d600b4c2ede7170e4905f2785c 100644 (file)
           {% block mediagoblin_header_title %}{% endblock %}
           <div class="header_right">
             {% if request.user %}
-              <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', user= request.user.username) }}">{{ request.user.username }}</a>{% trans %}'s account{% endtrans %}
+              {% trans
+                  user_url=request.urlgen('mediagoblin.user_pages.user_home',
+                                          user= request.user.username),
+                  user_name=request.user.username -%}
+                <a href="{{ user_url }}">{{ user_name }}</a>'s account
+              {%- endtrans %}
               (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>)
               {% if request.user and request.user.status == 'active' %}
                 <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}">{% trans %}Add media{% endtrans %}</a>
index 641306e8988f0d6cb64cdfa1263d26cc3bfd9fb7..31084c30cda1efb4a2bff7e7e1173c6c30d857e4 100644 (file)
       </ul>
       {% endif %}
 
-      <h2>{% trans %]Add attachment{% endtrans %}</h2>
+      <h2>{% trans %}Add attachment{% endtrans %}</h2>
       {{ wtforms_util.render_divs(form) }}
       <div class="form_submit_buttons">
-        <a href="{{ media.url_for_self(request.urlgen) }}">Cancel</a>
-        <input type="submit" value="Save changes" class="button_form" />
+        <a href="{{ media.url_for_self(request.urlgen) }}">
+          {%- trans %}Cancel{% endtrans -%}
+        </a>
+        <input type="submit" value="{% trans %}Save changes{% endtrans %}"
+               class="button_form" />
        {{ csrf_token }}
       </div>
     </div>
index 5f8ffea1fc47dc5143dbe8b6dd0cd775bd698255..25def4181ab53bdb747c4f47f4b5867c5e1bb8ae 100644 (file)
             </a>
 
             {% if item.note %}
-             {%- trans note=item.note -%}
              <br />
-              <a href="{{ entry_url }}">{{ note }}</a>
-             {%- endtrans -%}
+              <a href="{{ entry_url }}">{{ item.note }}</a>
             {% endif %}
            {% if request.user and
                   (item.in_collection.creator == request.user._id or 
                   request.user.is_admin) %}
-           {%- trans remove_url=request.urlgen(
+             {%- set remove_url=request.urlgen(
                                  'mediagoblin.user_pages.collection_item_confirm_remove',
                                  user=item.in_collection.get_creator.username,
                                  collection=item.in_collection.slug,
                                  collection_item=item.id) -%}
-             <br /><a href="{{ remove_url }}" class="remove">(remove)</a>
-           {%- endtrans -%}
+             <br />
+             <a href="{{ remove_url }}" class="remove">
+               {%- trans %}(remove){% endtrans -%}
+             </a>
            {% endif %}
           </td>
         {% endfor %}