浏览代码

Changes how locale scripts of Moment.js lib are loaded (#4403)

The scripts will now have it's name all in lowercase. This will make the server stops return 404 when requesting the script for locales like pt_BR
Everton Júnior 8 年之前
父节点
当前提交
058725528c
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Resources/views/standard_layout.html.twig

+ 5 - 1
Resources/views/standard_layout.html.twig

@@ -67,7 +67,11 @@ file that was distributed with this source code.
             {% set locale = app.request.locale %}
             {# localize moment #}
             {% if locale[:2] != 'en' %}
-                <script src="{{ asset('bundles/sonatacore/vendor/moment/locale/' ~ locale|replace({'_':'-'}) ~ '.js') }}"></script>
+                <script src="{{ asset(
+                    'bundles/sonatacore/vendor/moment/locale/' ~
+                    locale|lower|replace({'_':'-'}) ~
+                    '.js'
+                ) }}"></script>
             {% endif %}
 
             {# localize select2 #}