diff --git a/src/3rdparty/js/angular-bootstrap-multiselect.js b/src/3rdparty/js/angular-bootstrap-multiselect.js index 26efbcff3..c7bd58257 100644 --- a/src/3rdparty/js/angular-bootstrap-multiselect.js +++ b/src/3rdparty/js/angular-bootstrap-multiselect.js @@ -1,5 +1,12 @@ "use strict"; +// ------------------------------- +// WARNING +// ------------------------------- +// This file is taken from https://github.com/sebastianha/angular-bootstrap-multiselect +// There are local modifications like support for translation +// ------------------------------- + angular.module("ui.multiselect", ["multiselect.tpl.html"]) //from bootstrap-ui typeahead parser .factory("optionParser", ["$parse", function($parse) { @@ -23,7 +30,7 @@ angular.module("ui.multiselect", ["multiselect.tpl.html"]) } }; }]) - .directive("multiselect", ["$parse", "$document", "$compile", "$interpolate", "optionParser", function($parse, $document, $compile, $interpolate, optionParser) { + .directive("multiselect", ["$parse", "$document", "$compile", "$interpolate", "$translate", "optionParser", function($parse, $document, $compile, $interpolate, $translate, optionParser) { return { restrict: "E", require : "ngModel", @@ -154,7 +161,7 @@ angular.module("ui.multiselect", ["multiselect.tpl.html"]) function getHeaderText() { if(isEmpty(modelCtrl.$modelValue)) { - scope.header = attrs.msHeader || "Select"; + scope.header = attrs.msHeader || $translate.instant('main.multiselect.select'); return scope.header; } @@ -162,7 +169,7 @@ angular.module("ui.multiselect", ["multiselect.tpl.html"]) if(attrs.msSelected) { scope.header = $interpolate(attrs.msSelected)(scope); } else { - scope.header = modelCtrl.$modelValue.length + " " + "selected"; + scope.header = $translate.instant('main.multiselect.selected', { n: modelCtrl.$modelValue.length }); } } else { var local = {}; diff --git a/src/translation/de.json b/src/translation/de.json index 7f8a3006e..7ec667ec8 100644 --- a/src/translation/de.json +++ b/src/translation/de.json @@ -56,7 +56,11 @@ "warning": "Ein Neustart des Servers führt zu temporären Ausfallzeiten für alle Anwendungen, die auf dieser Cloudron-Instanz installiert sind!", "title": "Den Server wirklich neustarten?" }, - "searchPlaceholder": "Suche" + "searchPlaceholder": "Suche", + "multiselect": { + "selected": "{{ n }} ausgewählt", + "select": "Auswählen" + } }, "network": { "title": "Netzwerk", diff --git a/src/translation/en.json b/src/translation/en.json index 81493d77d..e08a376ba 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -56,7 +56,11 @@ "description": "Use this to apply security updates or if you experience unexpected behavior. All apps and services currently running on this Cloudron will automatically start when the reboot is complete.", "rebootAction": "Reboot now" }, - "searchPlaceholder": "Search" + "searchPlaceholder": "Search", + "multiselect": { + "selected": "{{ n }} selected", + "select": "Select" + } }, "appstore": { "title": "App Store",