瀏覽代碼

Patch missing translations

* Change '%' in the translation string to %% as it is being treated as
  part of string formatting
master
Janusz Harkot 13 年之前
父節點
當前提交
39a14b73ab

+ 8
- 6
oscar/apps/customer/forms.py 查看文件

@@ -165,8 +165,8 @@ class EmailUserCreationForm(forms.ModelForm):
165 165
 
166 166
 
167 167
 class SearchByDateRangeForm(forms.Form):
168
-    date_from = forms.DateField(required=False, label="From")
169
-    date_to = forms.DateField(required=False, label="To")
168
+    date_from = forms.DateField(required=False, label=_("From"))
169
+    date_to = forms.DateField(required=False, label=_("To"))
170 170
 
171 171
     def clean(self):
172 172
         if self.is_valid() and not self.cleaned_data['date_from'] and not self.cleaned_data['date_to']:
@@ -175,15 +175,17 @@ class SearchByDateRangeForm(forms.Form):
175 175
 
176 176
     def description(self):
177 177
         if not self.is_bound or not self.is_valid():
178
-            return 'All orders'
178
+            return _('All orders')
179 179
         date_from = self.cleaned_data['date_from']
180 180
         date_to = self.cleaned_data['date_to']
181 181
         if date_from and date_to:
182
-            return 'Orders placed between %s and %s' % (date_from, date_to)
182
+            return _('Orders placed between %(date_from)s and %(date_to)s') % {
183
+                'date_from': date_from,
184
+                'date_to': date_to }
183 185
         elif date_from and not date_to:
184
-            return 'Orders placed since %s' % date_from
186
+            return _('Orders placed since %s') % date_from
185 187
         elif not date_from and date_to:
186
-            return 'Orders placed until %s' % date_to
188
+            return _('Orders placed until %s') % date_to
187 189
 
188 190
     def get_filters(self):
189 191
         date_from = self.cleaned_data['date_from']

+ 1
- 1
oscar/apps/offer/models.py 查看文件

@@ -401,7 +401,7 @@ class Benefit(models.Model):
401 401
     SHIPPING_PERCENTAGE, SHIPPING_ABSOLUTE, SHIPPING_FIXED_PRICE = (
402 402
         'Shipping percentage', 'Shipping absolute', 'Shipping fixed price')
403 403
     TYPE_CHOICES = (
404
-        (PERCENTAGE, _("Discount is a % of the product's value")),
404
+        (PERCENTAGE, _("Discount is a %% of the product's value")),
405 405
         (FIXED, _("Discount is a fixed amount off the product's value")),
406 406
         (MULTIBUY, _("Discount is to give the cheapest product for free")),
407 407
         (FIXED_PRICE, _("Get the products that meet the condition for a fixed price")),

+ 1
- 1
oscar/templates/oscar/dashboard/catalogue/product_list.html 查看文件

@@ -91,7 +91,7 @@
91 91
 			    <div class="btn-toolbar">
92 92
                     <div class="btn-group">
93 93
                       <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
94
-                        Actions
94
+                        {% trans "Actions" %}
95 95
                         <span class="caret"></span>
96 96
                       </a>
97 97
                       <ul class="dropdown-menu pull-right">

+ 1
- 1
oscar/templates/oscar/dashboard/reports/index.html 查看文件

@@ -26,7 +26,7 @@
26 26
 
27 27
 {% block dashboard_content %}
28 28
 <div class="table-header">
29
-    <h3><i class="icon-bar-chart icon-large"></i>Reporting dashboard</h3>
29
+    <h3><i class="icon-bar-chart icon-large"></i>{% trans "Reporting dashboard" %}</h3>
30 30
 </div>
31 31
 <div class="well">
32 32
     <form method="get" action="." class="form-inline">

+ 2
- 1
oscar/templates/oscar/partials/image_input_widget.html 查看文件

@@ -1,7 +1,8 @@
1
+{% load i18n %}
1 2
 <div id="{{ image_id }}" class="image-input">
2 3
     <img src="{{ image_url }}" alt="thumbnail"/>
3 4
     {% if not image_url %}
4
-    <button class="btn btn-primary">Upload Image</button>
5
+    <button class="btn btn-primary">{% trans "Upload Image" %}</button>
5 6
     {% endif %}
6 7
     <div class="input-field">
7 8
         <input {{ input_attrs|safe }} />

Loading…
取消
儲存