Commit 0b9b83af authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_web_renderjs_ui: Translate the content of the Maximize button

Notably showned as a companion of the editor gadget
parent afb0a546
......@@ -335,6 +335,9 @@
scope: 'maximize',
element: div_max,
sandbox: 'public'
})
.push(function (button_maximize_gadget) {
return button_maximize_gadget.render();
});
})
.declareMethod('getContent', function getContent() {
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1009.27442.40137.15394</string> </value>
<value> <string>1017.65217.22701.26760</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1688063552.11</float>
<float>1726209635.9</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -6,6 +6,10 @@
<title>ERP5 Button Maximize</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_maximize_button.html">
<!--
data-i18n=Maximize
-->
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
......@@ -15,6 +19,6 @@
</head>
<body>
<button class="ui-icon-expand ui-btn-icon-notext" type="button">Maximize</button>
<button class="ui-icon-expand ui-btn-icon-notext" type="button" data-i18n="Maximize">Maximize</button>
</body>
</html>
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.5552.51560.44322</string> </value>
<value> <string>1019.17688.2597.57582</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1536322858.1</float>
<float>1726194811.78</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -5,6 +5,18 @@
rJS(window)
.declareAcquiredMethod('triggerMaximize', 'triggerMaximize')
.declareAcquiredMethod("translate", "translate")
.declareMethod('render', function () {
var gadget = this,
button_element = gadget.element.querySelector("button");
return gadget.translate(
button_element.getAttribute("data-i18n")
).then(function (translation) {
button_element.textContent = translation;
});
})
.onEvent('click', function (event) {
if (event.target.tagName === "BUTTON") {
......
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1009.17156.6548.44731</string> </value>
<value> <string>1019.17942.7601.18380</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1687447620.32</float>
<float>1726209989.54</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment