Commits

Anonymous committed d7e8696

Translation added to templates

  • Participants
  • Parent commits bcf5055

Comments (0)

Files changed (10)

eagadmin/views.py

 from google.appengine.ext.db import djangoforms
 from google.appengine.api import urlfetch, users
 from django.conf import settings
+import django.template
+django.template.add_to_builtins('django.templatetags.i18n')
 
 @admin_required
 def index(request, form=None):

templates/eagadmin/base.html

     {% block menu %}
       <ul id="TopMenu">
         <li class="{% block menu_sitetree %}{% endblock %}">
-          <a href="{% url eagadmin:index %}">Site Tree</a>
+          <a href="{% url eagadmin:index %}">{% trans "Site Tree" %}</a>
         </li>
         {% block menu_items %}{% endblock %}
       </ul>

templates/eagadmin/edit.html

 {% extends "eagadmin/sitetree-base.html" %}
-{% block title %}Edit Page » {{ page.title }} {% endblock %}
+{% block title %}{% trans "Edit Page" %} » {{ page.title }} {% endblock %}
 {% block content %}
   {% include "eagadmin/back-actions.html" %}
   <h1>Edit Page » {{ page.title }}</h1>
   {% endif %}
   <form action="{% url eagadmin:edit page.key %}" method="post">
     <fieldset id="PageInfo">
-      <legend>Page Info</legend>
+      <legend>{% trans "Page Info" %}</legend>
       {{ form.as_p }}
     </fieldset>
     <fieldset id="ContentInfo">
-      <legend>Content Info</legend>
+      <legend>{% trans "Content Info" %}</legend>
       {% if cform.fields %}
         {{ cform.as_p }}
       {% else %}
-        This page type has no content.
+        {% trans "This page type has no content" %}.
       {% endif %}
     </fieldset>
     <div>
-      <input type="submit" value="Save" />
+      <input type="submit" value="{% trans "Save" %}" />
     </div>
   </form>
 {% endblock %}

templates/eagadmin/error-msg.html

-<ul id="Messages"><li class="error">Please correct errors below</li></ul>
+<ul id="Messages"><li class="error">{% trans "Please correct errors below" %}</li></ul>

templates/eagadmin/index-page.html

 <div class="info">
   <span>{{ page.class_name }}</span>
-  <a class="change-type" href="{% url eagadmin:type page.key %}">Change type</a>
-  <a class="edit" href="{% url eagadmin:edit page.key %}">edit</a>
+  <a class="change-type" href="{% url eagadmin:type page.key %}">{% trans "Change type" %}</a>
+  <a class="edit" href="{% url eagadmin:edit page.key %}">{% trans "edit" %}</a>
   {% if not page.is_root %}
-  <a class="delete" href="{% url eagadmin:delete page.key %}">delete</a>
+  <a class="delete" href="{% url eagadmin:delete page.key %}">{% trans "delete" %}</a>
   {% else %}
-  <span class="delete">delete</span>{# Just for layout #}
+  <span class="delete">{% trans "delete" %}</span>{# Just for layout #}
   {% endif %}
 </div>
 {{ page.title }}

templates/eagadmin/index.html

 {% extends "eagadmin/sitetree-base.html" %}
 {% load eagadmin %}
-{% block title %}Site Tree{% endblock %}
+{% block title %}{% trans "Site Tree" %}{% endblock %}
 
 {% block content %}
   {% include "eagadmin/tree-actions.html" %}
   {% endfor %}
   </ul>
   <div id="OrderButtons" style="display: none;">
-    <button id="Cancel" onclick="location.href='{% url eagadmin:index %}';">Cancel</button>
-    <button id="SaveOrder">Save Order</button>
+    <button id="Cancel" onclick="location.href='{% url eagadmin:index %}';">{% trans "Cancel" %}</button>
+    <button id="SaveOrder">{% trans "Save Order" %}</button>
   </div>
 
   {% include "eagadmin/tree-actions.html" %}

templates/eagadmin/new.html

 {% extends "eagadmin/sitetree-base.html" %}
-{% block title %}New Page{% endblock %}
+{% block title %}{% trans "New Page" %}{% endblock %}
 {% block content %}
-  <h1>New Page</h1>
+  <h1>{% trans "New Page" %}</h1>
   {% if page_form.errors %}
     {% include "eagadmin/error-msg.html" %}
   {% endif %}
   <form action="{% url eagadmin:add %}" method="post">
     <fieldset id="PageInfo">
-      <legend>Page Info</legend>
+      <legend>{% trans "Page Info" %}</legend>
       {{ page_form.as_p }}
     </fieldset>
-    <div><input type="submit" value="Save" /></div>
+    <div><input type="submit" value="{% trans "Save" %}" /></div>
   </form>
 {% endblock %}
 {% block body_end %}

templates/eagadmin/noaccess.html

 {% extends "eagadmin/base.html" %}
 {% block menu %}{% endblock %}
 {% block content %}
-  <p>Sorry, you are not allowed to enter this zone</p>
+  <p>{% trans "Sorry, you are not allowed to enter this zone" %}</p>
 {% endblock %}

templates/eagadmin/tree-actions.html

 <ul id="Actions">
-  <li><a href="{% url eagadmin:new %}">Add New Page</a></li>
-  <li class="last"><a class="reorder-button" href="#reorder">Reorder</a></li>
+  <li><a href="{% url eagadmin:new %}">{% trans "Add New Page" %}</a></li>
+  <li class="last"><a class="reorder-button" href="#reorder">{% trans "Reorder" %}</a></li>
 </ul>

templates/eagadmin/type.html

 {% extends "eagadmin/sitetree-base.html" %}
-{% block title %} TODO {% endblock %}
+{% block title %}{% trans "Change Type Of" %} » {{ page.title }}{% endblock %}
 {% block content %}
   {% include "eagadmin/back-actions.html" %}
-  <h1>Change Type Of » {{ page.title }}</h1>
-  <p>WARNING! Some of page data could be lost!</p>
+  <h1>{% trans "Change Type Of" %} » {{ page.title }}</h1>
+  <p>{% trans "WARNING! Some of page data could be lost!" %}</p>
   <form action="{% url eagadmin:type page.key %}" method="POST">
     <fieldset id="PageInfo">
-      <legend>Chooce new type</legend>
+      <legend>{% trans "Chooce new type" %}</legend>
       {{ form.as_p }}
     </fieldset>
     <div>