浏览代码

HUE-7132 [frontend] Fix Selectize default placeholder i18n

Enrico Berti 8 年之前
父节点
当前提交
0ecbabc

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/ko.selectize.js

@@ -44,7 +44,7 @@ ko.bindingHandlers.browserAwareSelectize = {
 ko.bindingHandlers.selectize = {
   init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
     if (typeof allBindingsAccessor.get('optionsCaption') == 'undefined')
-      allBindingsAccessor = inject_binding(allBindingsAccessor, 'optionsCaption', 'Choose...');
+      allBindingsAccessor = inject_binding(allBindingsAccessor, 'optionsCaption', SelectizeGlobals.i18n.CHOOSE);
 
     ko.bindingHandlers.options.update(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext);
 

+ 6 - 0
desktop/core/src/desktop/templates/common_header_footer_components.mako

@@ -219,6 +219,12 @@ from metadata.conf import has_optimizer, OPTIMIZER
         SUCCESS: "${ _('Results copied successfully to the clipboard') }",
       }
     }
+
+    var SelectizeGlobals = {
+      i18n: {
+        CHOOSE: "${ _('Choose...') }"
+      }
+    }
   </script>
 
   <!--[if lt IE 9]>