diff --git a/assets/controllers/turbo/locale_menu_controller.js b/assets/controllers/turbo/locale_menu_controller.js deleted file mode 100644 index d55ff8da..00000000 --- a/assets/controllers/turbo/locale_menu_controller.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). - * - * Copyright (C) 2019 - 2022 Jan Böhmer (https://github.com/jbtronics) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -import { Controller } from '@hotwired/stimulus'; - -export default class extends Controller { - connect() { - const menu = document.getElementById('locale-select-menu'); - menu.innerHTML = this.element.innerHTML; - } -} \ No newline at end of file diff --git a/templates/_navbar.html.twig b/templates/_navbar.html.twig index d327a4f6..54be3fd0 100644 --- a/templates/_navbar.html.twig +++ b/templates/_navbar.html.twig @@ -159,7 +159,7 @@
- {# This menu is filled by 'turbo/locale_menu' controller from the _turbo_control.html.twig template, to always have the correct path #} + {# This menu is filled by a turbo-stream in _turbo_contro.html.twig #}
diff --git a/templates/_turbo_control.html.twig b/templates/_turbo_control.html.twig index aad3d051..281b21f2 100644 --- a/templates/_turbo_control.html.twig +++ b/templates/_turbo_control.html.twig @@ -21,15 +21,19 @@ {# Insert info about when the sidebar trees were updated last time, so the sidebar_tree_controller can decide if it needs to reload the tree #} -
- {% set locales = settings_instance('localization').languageMenuEntries %} - {% if locales is empty %} - {% set locales = locale_menu %} - {% endif %} + + + + - {% for locale in locales %} - - {{ locale|language_name }} ({{ locale|upper }}) - {% endfor %} -