diff --git a/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/gadget_textareafield.js.js b/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/gadget_textareafield.js.js index 952b99f5985abb05dd7d2c48f0f2fe9ab5b3828a..d17653cb10a6f2092f9b998cf818491e1c6992a2 100644 --- a/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/gadget_textareafield.js.js +++ b/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/gadget_textareafield.js.js @@ -5,11 +5,22 @@ rJS(window) .declareAcquiredMethod('notifyChange', 'notifyChange') + .declareAcquiredMethod('translateHtml', 'translateHtml') .declareMethod('render', function (options) { - this.element.firstChild.value = options.value || ""; - this.element.firstChild.title = options.key; - this.element.firstChild.setAttribute('data-name', - options.key || ""); + var form_gadget = this; + // gadgets can use translation methods also in xhtml style, + // this test gadget also exercise this. + return form_gadget + .translateHtml(form_gadget.element.innerHtml) + .push(function (html) { + form_gadget.element.innerHtml = html; + form_gadget.element.firstChild.value = options.value || ""; + form_gadget.element.firstChild.title = options.key; + form_gadget.element.firstChild.setAttribute( + "data-name", + options.key || "" + ); + }); }) .onEvent('change', function () { return this.notifyChange(); diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_gadgetfield.js.js b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_gadgetfield.js.js index 03fe06d01e912122bf3de034436716686321958b..551b25c0acc99bf81576fa925777584283b2bf44 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_gadgetfield.js.js +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_gadgetfield.js.js @@ -88,6 +88,17 @@ return this.element.querySelector('form').querySelector('[type="submit"]').click(); }) + // Comply to interface_translation.html, but without actually translating. + .allowPublicAcquisition('translate', function (argument_list) { + return argument_list[0]; + }) + .allowPublicAcquisition('getTranslationList', function (argument_list) { + return argument_list[0]; + }) + .allowPublicAcquisition('translateHtml', function (argument_list) { + return argument_list[0]; + }) + ///////////////////////////////////////////////////////////////// // declared methods /////////////////////////////////////////////////////////////////