Skip to content

Commit

Permalink
Fix default locales configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Oct 28, 2021
1 parent dc5d507 commit ea55240
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
Expand Down Expand Up @@ -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"]))
Expand Down
12 changes: 7 additions & 5 deletions Resources/views/layout/javascripts.html.twig
Original file line number Diff line number Diff line change
@@ -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") %}
Expand All @@ -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 = {
Expand All @@ -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 %}

Expand Down
6 changes: 3 additions & 3 deletions Resources/views/layout/stylesheets.html.twig
Original file line number Diff line number Diff line change
@@ -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") %}
Expand All @@ -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 = {
Expand All @@ -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 %}

0 comments on commit ea55240

Please sign in to comment.