Sfoglia il codice sorgente

Merge pull request #2538 from loicolas/patch-1

Include appropriate moment.js locale file
Andrej Hudec 10 anni fa
parent
commit
90aaedc354
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 7 2
      Resources/views/standard_layout.html.twig

+ 7 - 2
Resources/views/standard_layout.html.twig

@@ -55,9 +55,14 @@ file that was distributed with this source code.
                 {% endfor %}
             {% endif %}
 
+            {% set locale = app.request.locale %}
+            {# localize moment #}
+            {% if locale[:2] != 'en' %}
+                <script src="{{ asset('bundles/sonatacore/vendor/moment/locale/' ~ locale|replace({'_':'-'}) ~ '.js') }}"></script>
+            {% endif %}
+
             {# localize select2 #}
-            {% if admin_pool is defined and admin_pool.getOption('use_select2') %}
-                {% set locale = app.request.locale %}
+            {% if admin_pool is defined and admin_pool.getOption('use_select2') %}             
                 {% if locale == 'pt' %}{% set locale = 'pt_PT' %}{% endif %}
 
                 {# omit default EN locale #}