Commit a3215209 authored by Romain Courteaud's avatar Romain Courteaud

translate copy/paste message

parent 1e9867d5
......@@ -67,6 +67,14 @@
return Query.objectToSearchText(search_query);
}
function notifyTranslatedMessage(gadget, options) {
return gadget.getTranslationClipboardAction(options.message)
.push(function (translated_message) {
options.message = translated_message;
return gadget.notifySubmittedClipboardAction(options);
});
}
function triggerListboxClipboardAction(argument_list) {
var gadget = this,
action_list = ensureArray(gadget.state.erp5_document._links.action_object_list_action || []),
......@@ -91,8 +99,8 @@
}
if (view === undefined) {
// Action was not found.
return gadget.notifySubmittedClipboardAction({
"message": "Action not handled."
return notifyTranslatedMessage(gadget, {
"message": "Action not handled"
});
}
}
......@@ -114,16 +122,16 @@
// Dialog listbox use catalog method, which may be different from the current select method
// and so, it is mandatory to propagate a list of uid, otherwise, the dialog may display
// an unexpected huge list of unrelated documents
return gadget.notifySubmittedClipboardAction({
"message": "Nothing selected."
return notifyTranslatedMessage(gadget, {
"message": "Nothing selected"
});
}
if (action_name === 'copy_document_list') {
return gadget.setSettingClipboardAction('clipboard', checked_uid_list)
.push(function () {
return gadget.notifySubmittedClipboardAction({
"message": "Copied.",
return notifyTranslatedMessage(gadget, {
"message": "Copied",
"status": "success"
});
});
......@@ -145,6 +153,7 @@
function declareGadgetClassCanHandleListboxClipboardAction(gadget_klass) {
gadget_klass
.declareAcquiredMethod("getTranslationClipboardAction", "translate")
.declareAcquiredMethod("setSettingClipboardAction", "setSetting")
.declareAcquiredMethod("getSettingClipboardAction", "getSetting")
.declareAcquiredMethod("redirectClipboardAction", "redirect")
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.48373.9942.49254</string> </value>
<value> <string>974.48717.62365.58999</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1554112759.88</float>
<float>1554133445.38</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -5,6 +5,9 @@
data-i18n=Include
data-i18n=Exclude
data-i18n=Delete
data-i18n=Action not handled
data-i18n=Nothing selected
data-i18n=Copied
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
......
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>973.40657.63647.56780</string> </value>
<value> <string>974.44325.35023.55756</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1553869772.06</float>
<float>1554133441.35</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=Action not handled
data-i18n=Nothing selected
data-i18n=Copied
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>ERP5 PT Form View</title>
......
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>973.40657.63647.56780</string> </value>
<value> <string>974.44328.5575.6297</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1553869925.08</float>
<float>1554133516.84</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=Action not handled
data-i18n=Nothing selected
data-i18n=Copied
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>ERP5 PT Form View</title>
......
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.13790.51027.29644</string> </value>
<value> <string>974.48721.3468.18261</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1537194595.83</float>
<float>1554133509.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