Просмотр исходного кода

Add i18n support to category dashboard templates

master
David Winterbottom 13 лет назад
Родитель
Сommit
5a291700cb

+ 10
- 7
oscar/templates/oscar/dashboard/catalogue/category_delete.html Просмотреть файл

@@ -1,22 +1,23 @@
1 1
 {% extends 'dashboard/layout.html' %}
2
+{% load i18n %}
2 3
 
3 4
 {% block breadcrumbs %}
4 5
 <ul class="breadcrumb">
5 6
     <li>
6
-        <a href="{% url dashboard:index %}">Dashboard</a>
7
+		<a href="{% url dashboard:index %}">{% trans "Dashboard" %}</a>
7 8
         <span class="divider">/</span>
8 9
     </li>
9 10
     <li>
10
-        <a href="{% if parent %}{% url dashboard:catalogue-category-detail-list pk=parent.pk %}{% else %}{% url dashboard:catalogue-category-list %}{% endif %}">Categories</a>
11
+		<a href="{% if parent %}{% url dashboard:catalogue-category-detail-list pk=parent.pk %}{% else %}{% url dashboard:catalogue-category-list %}{% endif %}">{% trans "Categories" %}</a>
11 12
         <span class="divider">/</span>
12 13
     </li>
13
-    <li class="active"><a href=".">Delete category?</a></li>
14
+	<li class="active"><a href=".">{% trans "Delete category?" %}</a></li>
14 15
 </ul>
15 16
 {% endblock %}
16 17
 
17 18
 {% block header %}
18 19
 <div class="page-header">
19
-    <h1>Delete category?</h1>
20
+	<h1>{% trans "Delete category?" %}</h1>
20 21
 </div>
21 22
 {% endblock header%}
22 23
 
@@ -24,10 +25,12 @@
24 25
 <form action="." method="post">
25 26
     {% csrf_token %}
26 27
     {{ form }}
27
-    <p>Delete category <strong>{{ object.name }}</strong> - are you sure?</p>
28
+	{% blocktrans with name=object.name %}
29
+    <p>Delete category <strong>{{ name }}</strong> - are you sure?</p>
30
+	{% endblocktrans %}
28 31
     <div class="form-actions">
29
-        <button type="submit" class="btn btn-danger">Delete</button>
30
-        or <a href="{% if parent %}{% url dashboard:catalogue-category-detail-list pk=parent.pk %}{% else %}{% url dashboard:catalogue-category-list %}{% endif %}">cancel</a>
32
+		<button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
33
+		{% trans "or" %} <a href="{% if parent %}{% url dashboard:catalogue-category-detail-list pk=parent.pk %}{% else %}{% url dashboard:catalogue-category-list %}{% endif %}">{% trans "cancel" %}</a>
31 34
     </div>
32 35
 </form>
33 36
 {% endblock %}

+ 6
- 5
oscar/templates/oscar/dashboard/catalogue/category_form.html Просмотреть файл

@@ -1,19 +1,20 @@
1 1
 {% extends 'dashboard/layout.html' %}
2 2
 {% load category_tags %}
3
+{% load i18n %}
3 4
 {% block body_class %}catalogue{% endblock %}
4 5
 
5 6
 {% block title %}
6
-{{ title }} | Category management | {{ block.super }}
7
+{{ title }} | {% trans "Category management" %} | {{ block.super }}
7 8
 {% endblock %}
8 9
 
9 10
 {% block breadcrumbs %}
10 11
 <ul class="breadcrumb">
11 12
     <li>
12
-        <a href="{% url dashboard:index %}">Dashboard</a>
13
+		<a href="{% url dashboard:index %}">{% trans "Dashboard" %}</a>
13 14
         <span class="divider">/</span>
14 15
     </li>
15 16
     <li>
16
-        <a href="{% url dashboard:catalogue-category-list %}">Categories</a>
17
+		<a href="{% url dashboard:catalogue-category-list %}">{% trans "Categories" %}</a>
17 18
         <span class="divider">/</span>
18 19
     </li>
19 20
 	<li class="active"><a href=".">{{ title }}</a></li>
@@ -29,7 +30,7 @@
29 30
 {% block dashboard_content %}
30 31
 	<form action="." method="post" enctype="multipart/form-data">{% csrf_token %}
31 32
 		{{ form.as_p }}
32
-		<button type="submit" class="btn btn-primary btn-large">Save</button> or
33
-		<a href="{% url dashboard:catalogue-category-list %}">cancel</a>
33
+		<button type="submit" class="btn btn-primary btn-large">{% trans "Save" %}</button> {% trans "or" %}
34
+		<a href="{% url dashboard:catalogue-category-list %}">{% trans "cancel" %}</a>
34 35
 	</form>
35 36
 {% endblock dashboard_content %}

+ 15
- 13
oscar/templates/oscar/dashboard/catalogue/category_list.html Просмотреть файл

@@ -1,19 +1,21 @@
1 1
 {% extends 'dashboard/layout.html' %}
2 2
 {% load category_tags %}
3
+{% load i18n %}
4
+
3 5
 {% block body_class %}catalogue{% endblock %}
4 6
 
5 7
 {% block title %}
6
-Category management | {{ block.super }}
8
+{% trans "Category management" %} | {{ block.super }}
7 9
 {% endblock %}
8 10
 
9 11
 {% block breadcrumbs %}
10 12
 <ul class="breadcrumb">
11 13
     <li>
12
-        <a href="{% url dashboard:index %}">Dashboard</a>
14
+		<a href="{% url dashboard:index %}">{% trans "Dashboard" %}</a>
13 15
         <span class="divider">/</span>
14 16
     </li>
15 17
     <li>
16
-        <a href="{% url dashboard:catalogue-category-list %}">Category management</a>
18
+		<a href="{% url dashboard:catalogue-category-list %}">{% trans "Category management" %}</a>
17 19
         <span class="divider">/</span>
18 20
     </li>
19 21
 	<li class="active"><a href=".">{{ category.name }}</a></li>
@@ -22,13 +24,13 @@ Category management | {{ block.super }}
22 24
 
23 25
 {% block header %}
24 26
 <div class="page-header action">
25
-    <h1>Category management</h1>
27
+	<h1>{% trans "Category management" %}</h1>
26 28
 </div>
27 29
 {% endblock header %}
28 30
 
29 31
 {% block dashboard_content %}
30 32
 
31
-<p>You are editing:
33
+<p>{% trans "You are editing:" %}
32 34
 <a href="{% url dashboard:catalogue-category-list %}">Home</a>
33 35
 {% if ancestors %}
34 36
 	&gt;
@@ -41,9 +43,9 @@ Category management | {{ block.super }}
41 43
 <table class="table table-striped table-bordered">
42 44
 	<thead>
43 45
 		<tr>
44
-			<th>Name</th>
45
-			<th>Description</th>
46
-			<th>Number of child categories</th>
46
+			<th>{% trans "Name" %}</th>
47
+			<th>{% trans "Description" %}</th>
48
+			<th>{% trans "Number of child categories" %}</th>
47 49
 			<th></th>
48 50
 		</tr>
49 51
 	</thead>
@@ -54,16 +56,16 @@ Category management | {{ block.super }}
54 56
 			<td>{{ category.description|default:""|striptags|cut:"&nbsp;"|truncatewords:6 }}</td>
55 57
 			<td>{{ category.get_num_children }}</td>
56 58
             <td>
57
-                <a class="btn btn-primary" href="{% url dashboard:catalogue-category-update category.id %}">Edit category</a>
58
-				<a class="btn btn-primary {% if not category.has_children %}disabled{% endif %}" href="{% url dashboard:catalogue-category-detail-list pk=category.pk %}">Edit children</a>
59
-				<a class="btn btn-info" href="{{ category.get_absolute_url }}">View on site</a>
60
-                <a class="btn btn-danger" href="{% url dashboard:catalogue-category-delete category.id %}">Delete</a>
59
+				<a class="btn btn-primary" href="{% url dashboard:catalogue-category-update category.id %}">{% trans "Edit category" %}</a>
60
+				<a class="btn btn-primary {% if not category.has_children %}disabled{% endif %}" href="{% url dashboard:catalogue-category-detail-list pk=category.pk %}">{% trans "Edit children" %}</a>
61
+				<a class="btn btn-info" href="{{ category.get_absolute_url }}">{% trans "View on site" %}</a>
62
+				<a class="btn btn-danger" href="{% url dashboard:catalogue-category-delete category.id %}">{% trans "Delete" %}</a>
61 63
             </td>
62 64
         </tr>
63 65
     {% endfor %}
64 66
 	</tbody>
65 67
 </table>
66 68
 
67
-<a class="btn btn-large btn-primary" href="{% url dashboard:catalogue-category-create %}">Create a new category</a>
69
+<a class="btn btn-large btn-primary" href="{% url dashboard:catalogue-category-create %}">{% trans "Create a new category" %}</a>
68 70
 
69 71
 {% endblock dashboard_content %}

Загрузка…
Отмена
Сохранить