Преглед на файлове

Merge pull request #688 from Romain-Geissler/field-default-translation-catalogue

Field default translation catalogue
Thomas преди 13 години
родител
ревизия
9bc284079d
променени са 2 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 5 1
      Resources/views/CRUD/list_trans.html.twig
  2. 5 1
      Resources/views/CRUD/show_trans.html.twig

+ 5 - 1
Resources/views/CRUD/list_trans.html.twig

@@ -11,5 +11,9 @@ file that was distributed with this source code.
 {% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
 
 {% block field%}
-    {{value|trans({}, field_description.options.catalogue)}}
+    {% if field_description.options.catalogue is not defined %}
+        {{value|trans}}
+    {% else %}
+        {{value|trans({}, field_description.options.catalogue)}}
+    {% endif %}
 {% endblock %}

+ 5 - 1
Resources/views/CRUD/show_trans.html.twig

@@ -11,5 +11,9 @@ file that was distributed with this source code.
 {% extends 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
 
 {% block field%}
-    {{value|trans({}, field_description.options.catalogue)}}
+    {% if field_description.options.catalogue is not defined %}
+        {{value|trans}}
+    {% else %}
+        {{value|trans({}, field_description.options.catalogue)}}
+    {% endif %}
 {% endblock %}