Adding {% trans %} to all fixed strings in the templates
authorOsama Khalid <osamak@gnu.org>
Sun, 7 Aug 2011 20:36:55 +0000 (23:36 +0300)
committerOsama Khalid <osamak@gnu.org>
Sun, 7 Aug 2011 20:36:55 +0000 (23:36 +0300)
13 files changed:
mediagoblin/templates/mediagoblin/auth/login.html
mediagoblin/templates/mediagoblin/auth/register.html
mediagoblin/templates/mediagoblin/auth/resent_verification_email.html
mediagoblin/templates/mediagoblin/auth/verification_email.txt
mediagoblin/templates/mediagoblin/base.html
mediagoblin/templates/mediagoblin/edit/edit.html
mediagoblin/templates/mediagoblin/edit/edit_profile.html
mediagoblin/templates/mediagoblin/listings/tag.html
mediagoblin/templates/mediagoblin/root.html
mediagoblin/templates/mediagoblin/submit/start.html
mediagoblin/templates/mediagoblin/user_pages/gallery.html
mediagoblin/templates/mediagoblin/user_pages/media.html
mediagoblin/templates/mediagoblin/user_pages/user.html

index e25783eaa5c8436d3d7673e07821376dab8172f3..8b1e2296160737d04878373950bc91c53da8d75b 100644 (file)
   <form action="{{ request.urlgen('mediagoblin.auth.login') }}"
         method="POST" enctype="multipart/form-data">
     <div class="grid_6 prefix_1 suffix_1 form_box">
-      <h1>Log in</h1>
+      <h1>{% trans %}Log in{% endtrans %}</h1>
       {% if login_failed %}
-        <div class="form_field_error">Login failed!</div>
-      {% endif %}
-      {{ wtforms_util.render_divs(login_form) }}
+        <div class="form_field_error">{% trans %}Login failed!{%
+      endtrans %}</div> {% endif %} {{
+      wtforms_util.render_divs(login_form) }}
       <div class="form_submit_buttons">
-        <input type="submit" value="submit" class="button"/>
+        <input type="submit" value="{% trans %}Submit{% endtrans %}" class="button"/>
       </div>
       {% if next %}
         <input type="hidden" name="next" value="{{ next }}" class="button"
                style="display: none;"/>
       {% endif %}
       {% if allow_registration %}
-        <p>Don't have an account yet?<br /><a href="{{ request.urlgen('mediagoblin.auth.register') }}">Create one here!</a></p>
-      {% endif %}
+        <p>{% trans %}Don't have an account yet?{% endtrans
+      %}<br /><a href="{{ request.urlgen('mediagoblin.auth.register')
+      }}">{% trans %}Create one here!{% endtrans %}</a></p> {% endif
+      %}
     </div>
   </form>
 {% endblock %}
index f77b3782e546da5d5f47dbb641a87ca975ab15e9..5d512829a3946bf46eb5556171a81640c78d4fa6 100644 (file)
   <form action="{{ request.urlgen('mediagoblin.auth.register') }}"
         method="POST" enctype="multipart/form-data">
     <div class="grid_6 prefix_1 suffix_1 form_box">
-      <h1>Create an account!</h1>
+      <h1>{% trans %}Create an account!{% endtrans %}</h1>
       {{ wtforms_util.render_divs(register_form) }}
       <div class="form_submit_buttons">
-        <input type="submit" value="submit" class="button" />
+        <input type="submit" value="{% trans %}Submit{% endtrans %}"
+        class="button" />
       </div>
     </div>
   </form>
index da3a9e9983d5a47998ab8080c904c93288488770..8fd80ee92ddf682a06b32fa872ca215a6a8fe0b9 100644 (file)
@@ -19,6 +19,6 @@
 
 {% block mediagoblin_content %}
   <p>
-    Resent your verification email.
+    {% trans %}Resent your verification email.{% endtrans %}
   </p>
 {% endblock %}
index 7863374d2d9d4b3bb3f6a29dd6b076b6b07b6727..cb01600d1c23b8c0de9bfe98ae1ea3a2e2e68e4f 100644 (file)
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #}
-Hi {{ username }},
 
-to activate your GNU MediaGoblin account, open the following URL in your web browser
+{% trans username=username, verification_url=verification_url %}Hi {{ username }},
 
-{{ verification_url|safe }}
+to activate your GNU MediaGoblin account, open the following URL in
+your web browser:
+
+{{ verification_url|safe }}{% endtrans %}
index 4da685f9b29155634d04cfc545001029d00d4991..b9c98ef6e19853fa5f28e0414b6ed1aa37e674fa 100644 (file)
@@ -19,7 +19,7 @@
 <html>
   <head>
     <meta charset="utf-8">
-    <title>{% block title %}GNU MediaGoblin{% endblock title %}</title>
+    <title>{% block title %}{% trans %}GNU MediaGoblin{% endtrans %}{% endblock title %}</title>
     <link rel="stylesheet" type="text/css"
           href="{{ request.staticdirect('/css/extlib/reset.css') }}"/>
     <link rel="stylesheet" type="text/css"
               <a class="mediagoblin_logo"
                  href="{{ request.urlgen('index') }}">
                 <img src="{{ request.staticdirect('/images/logo.png') }}"
-                     alt="Mediagoblin logo" />
+                     alt="{% trans %}Mediagoblin logo{% endtrans %}" />
               </a>
             {% endblock %}
             {% if request.user and request.user['status'] == 'active' %}
               <a class="header_submit"
                  href="{{ request.urlgen('mediagoblin.submit.start') }}">
-                Submit media
+                {% trans %}Submit media{% endtrans %}
               </a>
             {% endif %}
             {% block mediagoblin_header_title %}{% endblock %}
@@ -59,7 +59,7 @@
                   <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
                                               user=request.user['username']) }}"
                      class="header_submit">
-                    verify your email!</a>
+                    {% trans %}verify your email!{% endtrans %}</a>
                 {% endif %}
 
                 <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
@@ -69,7 +69,7 @@
                 (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">logout</a>)
               {% else %}
                 <a href="{{ request.urlgen('mediagoblin.auth.login') }}">
-                  Login</a>
+                  {% trans %}Login{% endtrans %}</a>
               {% endif %}
             </div>
           </div>
@@ -85,7 +85,7 @@
       {% block mediagoblin_footer %}
         <div class="container_16">
           <div class="grid_16 mediagoblin_footer">
-            Powered by <a href="http://mediagoblin.org">MediaGoblin</a>, a <a href="http://gnu.org/">GNU project</a>
+            {% trans %}Powered by <a href="http://mediagoblin.org">MediaGoblin</a>, a <a href="http://gnu.org/">GNU project</a>{% endtrans %}
           </div>
         </div>
       {% endblock %}
index d19034cbd18600a0850d9439f2cbc410e7adc577..3dc170c81f608b09449773dc793af21e9886f5d4 100644 (file)
                                media= media._id) }}"
         method="POST" enctype="multipart/form-data">
     <div class="grid_8 prefix_1 suffix_1 edit_box form_box">
-      <h1>Editing {{ media.title }}</h1>
+      <h1>{% trans media_title=media.title %}Editing {{ media_title }}{% endtrans %}</h1>
       <div style="text-align: center;" >
         <img src="{{ request.app.public_store.file_url(
                          media['media_files']['thumb']) }}" />
       </div>
       {{ 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" />
+        <a href="{{ media.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a>
+        <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button" />
       </div>
     </div>
   </form>
index a11b86d75cd2998a623e711a2e720a9fc71ab5ec..4171cb4d40e4c731c70679667f079801a9f8a517 100644 (file)
                                                      user['username'] }}"
         method="POST" enctype="multipart/form-data">
     <div class="grid_8 prefix_1 suffix_1 edit_box form_box">
-      <h1>Editing {{ user['username'] }}'s profile</h1>
+      <h1>{% trans username=user['username'] %}Editing {{ username }}'s profile{% endtrans %}</h1>
       {{ wtforms_util.render_divs(form) }}
       <div class="form_submit_buttons">
-        <input type="submit" value="submit" class="button" />
+        <input type="submit" value="{% trans %}Submit{% endtrans %}" class="button" />
       </div>
     </div>
   </form>
index 6f10ec8da205295e03c44c8e068984062e1c3ba4..18123dbd862e7ea7975e366e0f190a563e1fbb07 100644 (file)
@@ -26,7 +26,7 @@
 
 {% block mediagoblin_content -%}
   <h1>
-    Media tagged with: {{ tag_name }}
+    {% trans %}Media tagged with:{% endtrans %} {{ tag_name }}
   </h1>
 
   <div class="container_16 media_gallery">
@@ -36,6 +36,6 @@
   <div class="grid_16">
     <a href="{{ request.urlgen(
                   'mediagoblin.listings.tag_atom_feed',
-                  tag=tag_slug) }}">atom feed</a>
+                  tag=tag_slug) }}">{% trans %}atom feed{% endtrans %}</a>
   </div>
 {% endblock %}
index ed7b931fc257e24d4881977323c1b1acf0d4cac7..3570374e62cf34711f0396b8431e4e606eadc7b1 100644 (file)
 
   {% if request.user %}
     <p>
-      <a href="{{ request.urlgen('mediagoblin.submit.start') }}">Submit an item</a> 
+      <a href="{{ request.urlgen('mediagoblin.submit.start') }}">{% trans %}Submit an item{% endtrans %}</a> 
     </p>
   {% else %}
     <p>
-      If you have an account, you can
-      <a href="{{ request.urlgen('mediagoblin.auth.login') }}">Login</a>.
+      {% trans login_url=request.urlgen('mediagoblin.auth.login') %}If you have an account, you can
+      <a href="{{ login_url }}">Login</a>.{% endtrans %}
     </p>
     {% if allow_registration %}
       <p>
-        If you don't have an account, please 
-        <a href="{{ request.urlgen('mediagoblin.auth.register') }}">Register</a>.
+        {% trans
+        register_url=request.urlgen('mediagoblin.auth.register') %}If you don't have an account, please 
+        <a href="{{ register_url }}">Register</a>.{% endtrans %}
       </p>
     {% endif %}
   {% endif %}
index 6d00510cbd71b3d56bf8aefadcd3489ed1235994..eb34c2e23f4aefe9add62fc5c94ce61cc6fbcbac 100644 (file)
   <form action="{{ request.urlgen('mediagoblin.submit.start') }}"
         method="POST" enctype="multipart/form-data">
     <div class="grid_8 prefix_1 suffix_1 form_box">
-      <h1>Submit yer media</h1>
+      <h1>{% trans %}Submit yer media{% endtrans %}</h1>
       {{ wtforms_util.render_field_div(submit_form.file) }}
       {{ wtforms_util.render_field_div(submit_form.title) }}
       {{ wtforms_util.render_textarea_div(submit_form.description) }}
       {{ wtforms_util.render_field_div(submit_form.tags) }}
       <div class="form_submit_buttons">
-      <input type="submit" value="Submit" class="button" />
+      <input type="submit" value="{% trans %}Submit{% endtrans %}" class="button" />
       </div>
     </div>
   </form>
index 637c892d5c400319cf1692dd52255252d5e7a5c2..71f14da4c908abd0603fd437bd4874bdab6c898c 100644 (file)
@@ -29,7 +29,9 @@
     <h1>
       <a href="{{ request.urlgen(
                       'mediagoblin.user_pages.user_home',
-                      user=user.username) }}">{{ user.username }}</a>'s media</h1>
+                      user=user.username) }}">{% trans
+                      username=user.username %}{{ username }}</a>'s
+                      media{% endtrans %}</h1>
 
     </div>
     <div class="container_16 media_gallery">
     <div class="grid_16">
       <a href={{ request.urlgen(
                      'mediagoblin.user_pages.atom_feed',
-                     user=user.username) }}>atom feed</a>
+                     user=user.username) }}>{% trans %}atom feed{% endtrans %}</a>
     </div>
   {% else %}
     {# This *should* not occur as the view makes sure we pass in a user. #}
-    <p>Sorry, no such user found.<p/>
+    <p>{% trans %}Sorry, no such user found.{% endtrans %}<p/>
   {% endif %}
 {% endblock %}    
index a138251877017b6a7dae1f888fa0ac3843e8483b..92894d0d3d6e6cd66234a52833abec0b49d13b9e 100644 (file)
       {% endautoescape %}
 
       <p>
-        &mdash;&nbsp;uploaded on
-        {{ "%4d-%02d-%02d"|format(media.created.year,
-                                  media.created.month, media.created.day) }}
-        by
-        <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
-                                   user= media.uploader().username) }}">
-          {{- media.uploader().username }}</a>
+        {% trans date="%4d-%02d-%02d"|format(media.created.year,
+               media.created.month, media.created.day), user_url=
+               request.urlgen('mediagoblin.user_pages.user_home',user=
+               media.uploader().username),
+               username=media.uploader().username %}
+               &mdash;&nbsp;uploaded on {{ date }} by <a href="{{
+               user_url }}">{{ username }}{% endtrans %}</a>
       </p>
       <br />
 
-      <h3>Comments</h3>
+      <h3>{% trans %}Comments{% endtrans %}</h3>
       {% if request.user %}
         <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', 
                                          user= media.uploader().username,
                                          media=media._id) }}" method="POST">
           {{ wtforms_util.render_field_div(comment_form.comment_content) }}
           <div class="form_submit_buttons">
-            <input type="submit" value="Post comment!" class="button" />
+            <input type="submit" value="{% trans %}Post comment!{% endtrans %}" class="button" />
           </div>
         </form>
       {% endif %}
@@ -77,7 +77,7 @@
             <div class="comment_author">&mdash; 
               <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
                                 user = comment_author['username']) }}">
-              {{ comment_author['username'] }}</a> at 
+              {{ comment_author['username'] }}</a> {% trans %}at{% endtrans %} 
             <!--</div>
             <div class="comment_datetime">-->
               <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment',
 
     <div class="grid_5 omega">
       {% include "mediagoblin/utils/prev_next.html" %}
-      <h3>Sidebar content here!</h3>
+      <h3>{% trans %}Sidebar content here!{% endtrans %}</h3>
 
       <p>
         {% if media['uploader'] == request.user['_id'] or 
           </p>
           <p>
             <img src="{{ request.staticdirect('/images/icon_delete.png') }}"
-                 class="media_icon" />delete
+                 class="media_icon" />{% trans %}delete{% endtrans %}
           </p>
         {% endif %}
       </p>
       {% endif %}
     </div>
   {% else %}
-    <p>Sorry, no such media found.<p/>
+    <p>{% trans %}Sorry, no such media found.{% endtrans %}<p/>
   {% endif %}
 {% endblock %}
index 76cf36bef5f2018ea0d76c0d8b32c95e708d7336..c3ad07dbbf23ad741a577decfbd9510e8d834dba 100644 (file)
 {% block mediagoblin_content -%}
   {# If no user... #}
   {% if not user %}
-    <p>Sorry, no such user found.<p/>
+    <p>{% trans %}Sorry, no such user found.{% endtrans %}<p/>
 
   {# User exists, but needs verification #}
   {% elif user.status == "needs_email_verification" %}
     {% if user == request.user %}
       {# this should only be visible when you are this user #}
       <div class="grid_6 prefix_1 suffix_1 form_box">
-        <h1>Verification needed</h1>
+        <h1>{% trans %}Verification needed{% endtrans %}</h1>
 
-        <p>Almost done! Your account still needs to be verified.</p>
+        <p>{% trans %}Almost done! Your account still needs to be
+        verified.{% endtrans %}</p>
         <p>
-          An email should arrive in a few moments with instructions
-          on how to do so.
+          {% trans %}An email should arrive in a few moments with
+          instructions on how to do so.{% endtrans %}
         </p>
-        <p>In case it doesn't:</p>
+        <p>{% trans %}In case it doesn't:{% endtrans %}</p>
   
         <a href="{{ request.urlgen('mediagoblin.auth.resend_verification') }}"
-           class="button">Resend verification email</a>
+           class="button">{% trans %}Resend verification email{% endtrans %}</a>
       </div>
     {% else %}
       {# if the user is not you, but still needs to verify their email #}
       <div class="grid_6 prefix_1 suffix_1 form_box">
-        <h1>Verification needed</h1>
+        <h1>{% trans %}Verification needed{% endtrans %}</h1>
 
         <p>
-          Someone has registered an account with this username, but it
-          still has to be verified.
+          {% trans %}Someone has registered an account with this
+          username, but it still has to be verified.{% endtrans %}
         </p>
   
         <p>
-          If you are that person but you've lost your verification
+          {% trans login_url=request.urlgen('mediagoblin.auth.login')
+          %}If you are that person but you've lost your verification
           email, you can
-          <a href="{{ request.urlgen('mediagoblin.auth.login') }}">log in</a>
-          and resend it.
+          <a href="{{ login_url }}">log in</a> and resend it.{%
+          endtrans %}
         </p>
       </div>
     {% endif %}
 
   {# Active(?) (or at least verified at some point) user, horray! #}
   {% else %}
-    <h1>{{ user.username }}'s profile</h1>
+    <h1>{% trans username=user.username %}{{ username }}'s profile{%
+    endtrans %}</h1>
 
     <div class="grid_6 alpha">
       {% include "mediagoblin/utils/profile.html" %}
       {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %}
         <a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{
-                        user.username }}">Edit profile</a>
+                        user.username }}">{% trans %}Edit profile{% endtrans %}</a>
       {% endif %}
     </div>
 
       {% set pagination_base_url = user_gallery_url %}
       {% include "mediagoblin/utils/object_gallery.html" %}
       <div class="clear"></div>
-      <p><a href="{{ user_gallery_url }}">View all of {{ user.username }}'s media</a></p>
-      <a href={{ request.urlgen(
-                     'mediagoblin.user_pages.atom_feed',
-                     user=user.username) }}>atom feed</a>
+      <p><a href="{{ user_gallery_url }}">{% trans
+      username=user.username %}View all of {{ username }}'s media{%
+      endtrans %}</a></p>
+      <a href={{ request.urlgen( 'mediagoblin.user_pages.atom_feed',
+                     user=user.username) }}>{% trans %}atom feed1{%
+                     endtrans %}</a>
     </div>
 
     <div class="clear"></div>