Skip to content

Commit

Permalink
Merge pull request #1720 from bolt/feature/use-bootbox-translations
Browse files Browse the repository at this point in the history
Use translated bootbox
  • Loading branch information
I-Valchev authored Aug 17, 2020
2 parents 106aae0 + 6669055 commit d8f501d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions assets/js/app/confirmation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import bootbox from 'bootbox';
import $ from 'jquery';

let bootboxDefaults = {
locale: 'en',
};

bootbox.setDefaults(bootboxDefaults);

let locale = $('html').attr('lang');

if (locale) {
bootbox.setLocale(locale);
}

$('*[data-confirmation]').on('click', function() {
const thisElem = $(this);
const thisHref = $(this).attr('href');
Expand Down
2 changes: 1 addition & 1 deletion templates/_base/layout.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# Check if aside has value and set hasAside variable #}
{% set hasAside = block('aside')|trim is not empty ? true : false %}
<!DOCTYPE html>
<html {% if block('html_id') %}id="{% block html_id %}{% endblock %}"{% endif %}>
<html lang="{{ app.user.locale }}" {% if block('html_id') %}id="{% block html_id %}{% endblock %}"{% endif %}>

<head>
<meta charset="utf-8">
Expand Down

0 comments on commit d8f501d

Please sign in to comment.