Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use translated bootbox #1720

Merged
merged 6 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions tests/php/Menu/FrontendMenuBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public function testLastItem(): void

$this->assertSame('The Bolt site', $lastItem->get('label'));
$this->assertSame('Visit the excellent Bolt website!', $lastItem->get('title'));
$this->assertSame('https://bolt.cm', $lastItem->get('link'));
$this->assertSame('https://boltcms.io', $lastItem->get('link'));
$this->assertSame('bolt-site', $lastItem->get('class'));
$this->assertNull($lastItem->get('submenu'));
$this->assertSame('https://bolt.cm', $lastItem->get('uri'));
$this->assertSame('https://boltcms.io', $lastItem->get('uri'));
$this->assertNull($lastItem->get('foobar'));
}

Expand Down