diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 91365097..0c7ff8de 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -55,7 +55,7 @@ private function addBootstrapMarkdownLocales(ArrayNodeDefinition $node, array $p $node ->children() - ->variableNode("bootstrap_markdown")->defaultValue("en")->info("Bootstrap Markdown locale") + ->variableNode("bootstrap_markdown")->info("Bootstrap Markdown locale") ->validate() ->ifNotInArray($plugins["bootstrap_markdown"]["locales"]) ->thenInvalid("The Bootstrap Markdown locale %s is not supported. Please choose one of " . json_encode($plugins["bootstrap_markdown"]["locales"])) @@ -115,7 +115,7 @@ private function addSummernoteLocales(ArrayNodeDefinition $node, array $plugins) $node ->children() - ->variableNode("summernote")->defaultValue("en-US")->info("Summernote locale") + ->variableNode("summernote")->info("Summernote locale") ->validate() ->ifNotInArray($plugins["summernote"]["locales"]) ->thenInvalid("The Summernote locale %s is not supported. Please choose one of " . json_encode($plugins["summernote"]["locales"])) diff --git a/Resources/views/layout/javascripts.html.twig b/Resources/views/layout/javascripts.html.twig index fbdf9670..91423aa1 100644 --- a/Resources/views/layout/javascripts.html.twig +++ b/Resources/views/layout/javascripts.html.twig @@ -1,5 +1,5 @@ {# Resources/views/layout/javascripts.html.twig #} -{% set _webPath = "bundles/wbwbootstrap" %} +{% set _rootPath = "bundles/wbwbootstrap" %} {% set _versions = getContainerParameter("wbw.bootstrap.asset.bootstrap").versions %} {% set _plugins = getContainerParameter("wbw.bootstrap.asset.bootstrap").plugins %} {% set _appVersion = getContainerParameter("wbw_bootstrap.version") %} @@ -9,8 +9,8 @@ {% if ("prod" != app.environment) %} <!-- Bootstrap --> {% endif %} -<script type="text/javascript" src="{{ asset(_webPath ~ "/popper.js-1.15.0/umd/popper.min.js") }}"></script> -<script type="text/javascript" src="{{ asset(_webPath ~ "/bootstrap-{{ version }}/js/bootstrap.min.js"|replace({"{{ version }}": _versions[_appVersion]})) }}"></script> +<script type="text/javascript" src="{{ asset(_rootPath ~ "/popper.js-1.15.0/umd/popper.min.js") }}"></script> +<script type="text/javascript" src="{{ asset(_rootPath ~ "/bootstrap-{{ version }}/js/bootstrap.min.js"|replace({"{{ version }}": _versions[_appVersion]})) }}"></script> {% for _appPlugin in _appPlugins %} {% set _replaces = { @@ -24,8 +24,10 @@ <!-- {{ _plugins[_appPlugin].description }} --> {% endif %} - {% set _path = (_webPath ~ _javascript)|replace(_replaces) %} - <script type="text/javascript" src="{{ asset(_path) }}"></script> + {% if ("{{ locale }}" not in _javascript or ("{{ locale }}" in _javascript and _appLocales[_appPlugin] is defined)) %} + {% set _path = (_rootPath ~ _javascript)|replace(_replaces) %} + <script type="text/javascript" src="{{ asset(_path) }}"></script> + {% endif %} {% endfor %} {% endfor %} diff --git a/Resources/views/layout/stylesheets.html.twig b/Resources/views/layout/stylesheets.html.twig index 4580eb6c..1af0c7f3 100644 --- a/Resources/views/layout/stylesheets.html.twig +++ b/Resources/views/layout/stylesheets.html.twig @@ -1,5 +1,5 @@ {# Resources/views/layout/stylesheets.html.twig #} -{% set _webPath = "bundles/wbwbootstrap" %} +{% set _rootPath = "bundles/wbwbootstrap" %} {% set _versions = getContainerParameter("wbw.bootstrap.asset.bootstrap").versions %} {% set _plugins = getContainerParameter("wbw.bootstrap.asset.bootstrap").plugins %} {% set _appVersion = getContainerParameter("wbw_bootstrap.version") %} @@ -8,7 +8,7 @@ {% if ("prod" != app.environment) %} <!-- Bootstrap --> {% endif %} -<link type="text/css" rel="stylesheet" href="{{ asset(_webPath ~ "/bootstrap-{{ version }}/css/bootstrap.min.css"|replace({"{{ version }}": _versions[_appVersion]})) }}"> +<link type="text/css" rel="stylesheet" href="{{ asset(_rootPath ~ "/bootstrap-{{ version }}/css/bootstrap.min.css"|replace({"{{ version }}": _versions[_appVersion]})) }}"> {% for _appPlugin in _appPlugins %} {% set _replaces = { @@ -22,7 +22,7 @@ <!-- {{ _plugins[_appPlugin].description }} --> {% endif %} - {% set _path = (_webPath ~ _stylesheet)|replace(_replaces) %} + {% set _path = (_rootPath ~ _stylesheet)|replace(_replaces) %} <link type="text/css" rel="stylesheet" href="{{ asset(_path) }}"> {% endfor %} {% endfor %}