Ver código fonte

i18n fixes (#3965)

* i18n fixes

Use i18n for search placeholder
Add i18n usage for Surcharge and Range abstract models where it was
missing

* Add trans to aria-label

* Add missing verbose names in migrations

---------

Co-authored-by: Viggodevries <viggo@highbiza.nl>
master
Alexey 2 anos atrás
pai
commit
55b3773050
Nenhuma conta vinculada ao e-mail do autor do commit

+ 1
- 1
src/oscar/apps/offer/abstract_models.py Ver arquivo

@@ -837,7 +837,7 @@ class AbstractRange(models.Model):
837 837
     slug = fields.AutoSlugField(
838 838
         _("Slug"), max_length=128, unique=True, populate_from="name")
839 839
 
840
-    description = models.TextField(blank=True)
840
+    description = models.TextField(_("Description"), blank=True)
841 841
 
842 842
     # Whether this range is public
843 843
     is_public = models.BooleanField(

+ 1
- 1
src/oscar/apps/offer/migrations/0001_initial.py Ver arquivo

@@ -82,7 +82,7 @@ class Migration(migrations.Migration):
82 82
                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
83 83
                 ('name', models.CharField(unique=True, max_length=128, verbose_name='Name')),
84 84
                 ('slug', oscar.models.fields.autoslugfield.AutoSlugField(populate_from='name', unique=True, verbose_name='Slug', max_length=128, editable=False, blank=True)),
85
-                ('description', models.TextField(blank=True)),
85
+                ('description', models.TextField(verbose_name="Description", blank=True)),
86 86
                 ('is_public', models.BooleanField(default=False, verbose_name='Is public?', help_text='Public ranges have a customer-facing page')),
87 87
                 ('includes_all_products', models.BooleanField(default=False, verbose_name='Includes all products?')),
88 88
                 ('proxy_class', oscar.models.fields.NullCharField(unique=True, verbose_name='Custom class', default=None, max_length=255)),

+ 2
- 0
src/oscar/apps/order/abstract_models.py Ver arquivo

@@ -1197,3 +1197,5 @@ class AbstractSurcharge(models.Model):
1197 1197
         abstract = True
1198 1198
         app_label = 'order'
1199 1199
         ordering = ['pk']
1200
+        verbose_name = _("Surcharge")
1201
+        verbose_name_plural = _("Surcharges")

+ 3
- 1
src/oscar/apps/order/migrations/0009_surcharge.py Ver arquivo

@@ -27,7 +27,9 @@ class Migration(migrations.Migration):
27 27
             ],
28 28
             options={
29 29
                 'abstract': False,
30
-                'ordering': ['pk']
30
+                'ordering': ['pk'],
31
+                'verbose_name': 'Surcharge',
32
+                'verbose_name_plural': 'Surcharges'
31 33
             },
32 34
         ),
33 35
     ]

+ 1
- 1
src/oscar/templates/oscar/partials/search.html Ver arquivo

@@ -1,6 +1,6 @@
1 1
 {% load i18n %}
2 2
 
3 3
 <form class="form-inline my-2 my-lg-0" method="GET" action="{% url 'search:search' %}">
4
-    <input class="form-control mr-sm-2" name="q" placeholder="Search" aria-label="Search">
4
+    <input class="form-control mr-sm-2" name="q" placeholder="{% trans 'Search' %}" aria-label="{% trans 'Search' %}">
5 5
     <button class="btn btn btn-secondary my-2 my-sm-0" type="submit">{% trans "Search" %}</button>
6 6
 </form>

Carregando…
Cancelar
Salvar