diff --git a/bower.json b/bower.json index aee827166..135e91949 100644 --- a/bower.json +++ b/bower.json @@ -11,7 +11,7 @@ "angular-csv-import": "~0.0.29", "angular-formly": "~7.3.9", "angular-formly-templates-bootstrap": "~6.2.0", - "angular-gettext": "~2.2.0", + "angular-gettext": "~2.3.4", "angular-loading-bar": "~0.8.0", "angular-messages": "~1.4.10", "angular-pdf": "~1.3.0", diff --git a/openslides/core/config_variables.py b/openslides/core/config_variables.py index 019a682a2..3e5a3e170 100644 --- a/openslides/core/config_variables.py +++ b/openslides/core/config_variables.py @@ -151,6 +151,7 @@ def get_config_variables(): yield ConfigVariable( name='projector_default_countdown', default_value=60, + input_type='integer', label='Default countdown', weight=185, group='Projector') diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index 37f9ec6d0..07bf1811e 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -389,7 +389,8 @@ angular.module('OpenSlidesApp.core.site', [ .directive('osFormField', [ '$parse', 'Config', - function($parse, Config) { + 'gettextCatalog', + function($parse, Config, gettextCatalog) { function getHtmlType(type) { return { string: 'text', @@ -410,15 +411,19 @@ angular.module('OpenSlidesApp.core.site', [ var config = Config.get(field.key); $scope.type = getHtmlType(field.input_type); if ($scope.type == 'choice') { - $scope.choices = field.choices; + $scope.choices = []; + angular.forEach(field.choices, function(choice) { + choice.display_name = gettextCatalog.getString(choice.display_name); + $scope.choices.push(choice); + }); } $scope.label = field.label; $scope.key = 'field-' + field.key; - $scope.value = config.value; + $scope.value = gettextCatalog.getString(config.value); $scope.help_text = field.help_text; $scope.default_value = field.default_value; $scope.reset = function () { - $scope.value = $scope.default_value; + $scope.value = gettextCatalog.getString($scope.default_value); $scope.save(field.key, $scope.value); }; } diff --git a/openslides/core/static/templates/config-form-field.html b/openslides/core/static/templates/config-form-field.html index 64cd7f555..ab6f2c8c5 100644 --- a/openslides/core/static/templates/config-form-field.html +++ b/openslides/core/static/templates/config-form-field.html @@ -1,10 +1,11 @@
{{ help_text }}
+{{ help_text | translate }}