Commit 950a8237 authored by Xiaowu Zhang's avatar Xiaowu Zhang

Fix translation bug in dialog gadget

parent 729cb937
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
/*jslint nomen: true, indent: 2, maxerr: 3 */\n /*jslint nomen: true, indent: 2, maxerr: 3 */\n
/*global window, rJS, RSVP, FormData, jIO, URI, loopEventListener */\n /*global window, rJS, RSVP, FormData, jIO, URI, loopEventListener, document */\n
(function (window, rJS, RSVP, FormData, jIO, URI, loopEventListener) {\n (function (window, rJS, RSVP, FormData, jIO, URI, loopEventListener) {\n
"use strict";\n "use strict";\n
\n \n
...@@ -136,10 +136,10 @@ ...@@ -136,10 +136,10 @@
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n .declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n
.declareAcquiredMethod("whoWantToDisplayThisPage", "whoWantToDisplayThisPage")\n .declareAcquiredMethod("whoWantToDisplayThisPage", "whoWantToDisplayThisPage")\n
.declareAcquiredMethod("whoWantToDisplayThis", "whoWantToDisplayThis")\n .declareAcquiredMethod("whoWantToDisplayThis", "whoWantToDisplayThis")\n
.declareAcquiredMethod("translateHtml", "translateHtmlt")\n
.declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n .declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")\n .declareAcquiredMethod("notifySubmitting", "notifySubmitting")\n
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")\n .declareAcquiredMethod("notifySubmitted", "notifySubmitted")\n
.declareAcquiredMethod("translateHtml", "translateHtml")\n
\n \n
\n \n
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
...@@ -167,6 +167,7 @@ ...@@ -167,6 +167,7 @@
i,\n i,\n
icon,\n icon,\n
span = document.createElement("span"),\n span = document.createElement("span"),\n
section = form_gadget.__element.querySelector("section"),\n
selector = form_gadget.__element.querySelector("h3"),\n selector = form_gadget.__element.querySelector("h3"),\n
view_list = erp5_document._links.action_workflow || [];\n view_list = erp5_document._links.action_workflow || [];\n
\n \n
...@@ -175,7 +176,7 @@ ...@@ -175,7 +176,7 @@
title = view_list[i].title;\n title = view_list[i].title;\n
}\n }\n
}\n }\n
\n \n
// XXX hardcoded...\n // XXX hardcoded...\n
switch (title) {\n switch (title) {\n
case "Create User": icon = " ui-icon-user"; break;\n case "Create User": icon = " ui-icon-user"; break;\n
...@@ -195,28 +196,27 @@ ...@@ -195,28 +196,27 @@
form_options.form_definition = options.form_definition;\n form_options.form_definition = options.form_definition;\n
form_options.view = options.view;\n form_options.view = options.view;\n
\n \n
return RSVP.all([\n return new RSVP.Queue()\n
erp5_form.render(form_options),\n .push(function () {\n
form_gadget.whoWantToDisplayThis(options.jio_key),\n return form_gadget.translateHtml(section.innerHTML);\n
form_gadget.whoWantToDisplayThisPage({page: "breadcrumb"})\n })\n
]);\n .push(function (my_translation_html) {\n
})\n section.innerHTML = my_translation_html;\n
.push(function (all_result) {\n return RSVP.all([\n
return form_gadget.renderPageHeader({\n erp5_form.render(form_options),\n
cancel_url: all_result[1],\n form_gadget.whoWantToDisplayThis(options.jio_key),\n
page_title: options.erp5_document.title,\n form_gadget.whoWantToDisplayThisPage({page: "breadcrumb"})\n
breadcrumb_url: all_result[2],\n ]);\n
submit_action: true\n })\n
});\n .push(function (all_result) {\n
})\n return form_gadget.renderPageHeader({\n
// XXX: DOM touches\n cancel_url: all_result[1],\n
.push(function () {\n page_title: options.erp5_document.title,\n
return form_gadget.translateHtml(form_gadget.props.element.innerHTML);\n breadcrumb_url: all_result[2],\n
})\n submit_action: true\n
.push(function (my_translated_html) {\n });\n
form_gadget.props.element.innerHTML = my_translated_html;\n });\n
});\n });\n
\n
})\n })\n
\n \n
\n \n
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>super_sven</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>939.52858.22584.102</string> </value> <value> <string>940.11718.18032.58982</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -435,8 +435,8 @@ ...@@ -435,8 +435,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1419417804.84</float> <float>1420812706.24</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
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