Commit 9e4a16df authored by Sven Franck's avatar Sven Franck Committed by Xiaowu Zhang

erp5_web_renderjs_ui: add translation to gadgets containing text

parent bc27e73b
......@@ -125,7 +125,7 @@
<!-- XXX need theme here currently -->\n
<script id="table-template" type="text/x-handlebars-template">\n
<section class="ui-content-header-plain">\n
<h3 class="ui-content-title ui-body-c">\n
<h3 class="ui-content-title ui-body-c" data-i18n="[last]{{definition_i18n}}">\n
<span class="ui-icon ui-icon-custom ui-icon-random">&nbsp;</span>\n
{{definition_title}}\n
</h3>\n
......@@ -133,7 +133,7 @@
\n
<ul data-role="listview" data-theme="c" data-inset="true" class="document-listview">\n
{{#each documentlist}}\n
<li><a class="ui-body-inherit" href="{{link}}">{{title}}</a></li>\n
<li><a data-i18n="{{i18n}}" class="ui-body-inherit" href="{{link}}">{{title}}</a></li>\n
{{/each}}\n
</ul>\n
\n
......@@ -265,7 +265,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -279,7 +279,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>938.24736.3025.60689</string> </value>
<value> <string>939.43978.9403.31744</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -297,7 +297,7 @@
</tuple>
<state>
<tuple>
<float>1413815082.99</float>
<float>1419266049.54</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -137,6 +137,7 @@
// Acquired methods\n
/////////////////////////////////////////////////////////////////\n
.declareAcquiredMethod("jio_get", "jio_get")\n
.declareAcquiredMethod("translateElementList", "translateElementList")\n
.declareAcquiredMethod("whoWantToDisplayThisPage", "whoWantToDisplayThisPage")\n
.declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n
\n
......@@ -176,14 +177,16 @@
for (i = 2; i < all_result.length; i += 1) {\n
tab_list.push({\n
title: view_list[i - 2].title,\n
link: all_result[i]\n
link: all_result[i],\n
i18n: view_list[i - 2].title\n
});\n
}\n
\n
\n
gadget.props.element.innerHTML = table_template({\n
definition_title: "Workflow Transitions",\n
documentlist: tab_list\n
documentlist: tab_list,\n
definition_i18n: "Workflow-Transitions"\n
});\n
\n
return gadget.renderPageHeader({\n
......@@ -191,6 +194,9 @@
page_title: erp5_document.title,\n
breadcrumb_url: all_result[1]\n
});\n
})\n
.push(function () {\n
return gadget.translateElementList(gadget.props.element);\n
});\n
\n
});\n
......@@ -318,7 +324,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -332,7 +338,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>937.58328.20811.57019</string> </value>
<value> <string>939.52883.6676.56371</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -350,7 +356,7 @@
</tuple>
<state>
<tuple>
<float>1411984843.95</float>
<float>1419349656.69</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -125,7 +125,7 @@
<!-- XXX need theme here currently -->\n
<script id="table-template" type="text/x-handlebars-template">\n
<section class="ui-content-header-plain">\n
<h3 class="ui-content-title ui-body-c">\n
<h3 class="ui-content-title ui-body-c" data-i18n="[last]{{definition_title}}">\n
<span class="ui-icon ui-icon-custom ui-icon-ellipsis-v">&nbsp;</span>\n
{{definition_title}}\n
</h3>\n
......@@ -133,7 +133,7 @@
\n
<ul data-role="listview" data-theme="c" data-inset="true" class="document-listview">\n
{{#each documentlist}}\n
<li><a class="ui-body-inherit" href="{{link}}">{{title}}</a></li>\n
<li><a data-i18n="{{title}}" class="ui-body-inherit" href="{{link}}">{{title}}</a></li>\n
{{/each}}\n
</ul>\n
</script>\n
......@@ -264,7 +264,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>938.25856.43701.35037</string> </value>
<value> <string>939.43978.9403.31744</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -296,7 +296,7 @@
</tuple>
<state>
<tuple>
<float>1413883420.45</float>
<float>1419349814.99</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -137,6 +137,7 @@
.declareAcquiredMethod("jio_get", "jio_get")\n
.declareAcquiredMethod("whoWantToDisplayThisPage", "whoWantToDisplayThisPage")\n
.declareAcquiredMethod("whoWantToDisplayThis", "whoWantToDisplayThis")\n
.declareAcquiredMethod("translateElementList", "translateElementList")\n
.declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n
\n
/////////////////////////////////////////////////////////////////\n
......@@ -203,6 +204,9 @@
});\n
\n
return gadget.renderPageHeader(header_options);\n
})\n
.push(function () {\n
return gadget.translateElementList(gadget.props.element);\n
});\n
\n
});\n
......@@ -328,7 +332,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -342,7 +346,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>938.26113.11046.50244</string> </value>
<value> <string>939.43978.9403.31744</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -360,7 +364,7 @@
</tuple>
<state>
<tuple>
<float>1413897881.85</float>
<float>1419349887.08</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -130,7 +130,7 @@
\n
<!-- XXX action, method, fieldset -->\n
<form class="dialog_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
<button type="submit" data-i18n="Submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>\n
<div data-gadget-url="gadget_erp5_form.html"\n
data-gadget-scope="erp5_form"\n
......@@ -261,7 +261,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>937.64343.1806.54016</string> </value>
<value> <string>939.43978.9403.31744</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1413880520.29</float>
<float>1419347929.19</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -136,6 +136,7 @@
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n
.declareAcquiredMethod("whoWantToDisplayThisPage", "whoWantToDisplayThisPage")\n
.declareAcquiredMethod("whoWantToDisplayThis", "whoWantToDisplayThis")\n
.declareAcquiredMethod("translateElementList", "translateElementList")\n
.declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")\n
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")\n
......@@ -187,6 +188,7 @@
span.textContent = "\\u00A0";\n
selector.appendChild(span);\n
selector.appendChild(document.createTextNode(title));\n
selector.setAttribute("data-i18n", "[last]" + title);\n
\n
// <span class="ui-icon ui-icon-custom ui-icon-random">&nbsp;</span>\n
form_options.erp5_document = options.erp5_document;\n
......@@ -206,6 +208,9 @@
breadcrumb_url: all_result[2],\n
submit_action: true\n
});\n
})\n
.push(function () {\n
return form_gadget.translateElementList(form_gadget.props.element);\n
});\n
})\n
\n
......@@ -393,7 +398,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -407,7 +412,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>938.25845.4177.6041</string> </value>
<value> <string>939.52858.19121.54596</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -425,7 +430,7 @@
</tuple>
<state>
<tuple>
<float>1413881685.29</float>
<float>1419348140.66</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -126,11 +126,11 @@
<fieldset class="center">\n
<form class="login_form">\n
<div class="ui-card ui-body-inherit ui-corner-all ui-shadow ui-content ui-responsive">\n
<label>Login:</label>\n
<label data-i18n="">Login:</label>\n
<div class="ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset">\n
<input type="text" required="required" data-enhanced="true" name="login" value="" />\n
</div>\n
<label>Password:</label>\n
<label data-i18n="Password">Password:</label>\n
<div class="ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset">\n
<input type="password" required="required" name="password" value="" data-enhanced="true" />\n
</div>\n
......@@ -141,7 +141,7 @@
<div class="ui-block-b">\n
<div class="ui-btn ui-btn-b ui-input-btn ui-corner-all ui-icon-carat-r ui-btn-icon-right">\n
<span>Login</span>\n
<input data-enhanced="true" type="submit" value="Login" />\n
<input data-enhanced="true" type="submit" data-i18n="[value]Login" value="Login" />\n
</div>\n
</div>\n
</div>\n
......@@ -274,7 +274,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -288,7 +288,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>937.49599.22266.28279</string> </value>
<value> <string>939.43978.9403.31744</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -306,7 +306,7 @@
</tuple>
<state>
<tuple>
<float>1411461090.07</float>
<float>1419348948.68</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -125,12 +125,18 @@
// handle acquisition\n
/////////////////////////////////////////////////////////////////\n
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n
.declareAcquiredMethod("translateElementList", "translateElementList")\n
\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
.declareMethod("render", function () {\n
return "ok";\n
var gadget = this;\n
\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.translateElementList(g.props.element);\n
});\n
})\n
\n
.declareService(function () {\n
......@@ -152,7 +158,6 @@
document.cookie = "__ac=" + window.btoa(login + ":" + passwd);\n
// XXX Hardcoded non generic redirection to the frontpage\n
return form_gadget.pleaseRedirectMyHash("#");\n
\n
});\n
\n
});\n
......@@ -277,7 +282,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -291,7 +296,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>937.49597.63791.22067</string> </value>
<value> <string>939.43978.9403.31744</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -309,7 +314,7 @@
</tuple>
<state>
<tuple>
<float>1411461067.42</float>
<float>1419349125.71</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -124,14 +124,14 @@
\n
<script id="table-template" type="text/x-handlebars-template">\n
<section class="ui-content-header-plain">\n
<h3 class="ui-content-title ui-body-c">\n
<h3 class="ui-content-title ui-body-c" data-i18n="[last]{{definition_i18n}}">\n
<span class="ui-icon ui-icon-custom ui-icon-{{definition_icon}}">&nbsp;</span>\n
{{definition_title}}\n
</h3>\n
</section>\n
<ul data-role="listview" data-theme="c" data-inset="true" class="document-listview">\n
{{#each documentlist}}\n
<li><a class="ui-body-inherit" href="{{link}}">{{title}}</a></li>\n
<li><a data-i18n="{{i18n}}" class="ui-body-inherit" href="{{link}}">{{title}}</a></li>\n
{{/each}}\n
</ul>\n
</script>\n
......@@ -262,7 +262,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -276,7 +276,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>938.25853.26425.62054</string> </value>
<value> <string>939.51478.33243.40192</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -294,7 +294,7 @@
</tuple>
<state>
<tuple>
<float>1413882117.05</float>
<float>1419265777.06</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -138,6 +138,7 @@
/////////////////////////////////////////////////////////////////\n
.declareAcquiredMethod("jio_get", "jio_get")\n
.declareAcquiredMethod("whoWantToDisplayThisPage", "whoWantToDisplayThisPage")\n
.declareAcquiredMethod("translateElementList", "translateElementList")\n
.declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n
\n
/////////////////////////////////////////////////////////////////\n
......@@ -182,6 +183,7 @@
for (i = 0; i < all_result.length - 1; i += 1) {\n
tab_list.push({\n
title: view_list[i].title,\n
i18n: view_list[i].title,\n
link: all_result[i]\n
});\n
}\n
......@@ -189,6 +191,7 @@
\n
gadget.props.element.innerHTML = table_template({\n
definition_title: "Views",\n
definition_i18n: "Views",\n
definition_icon: "eye",\n
documentlist: [{\n
title: view_list[0].title,\n
......@@ -196,6 +199,7 @@
}]\n
}) + table_template({\n
definition_title: "Editables",\n
definition_i18n: "Editables",\n
definition_icon: "edit",\n
documentlist: tab_list\n
});\n
......@@ -203,6 +207,9 @@
return gadget.renderPageHeader({\n
cancel_url: tab_list[matching].link\n
});\n
})\n
.push(function () {\n
return gadget.translateElementList(gadget.props.element);\n
});\n
\n
});\n
......@@ -330,7 +337,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -344,7 +351,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>938.218.49333.26675</string> </value>
<value> <string>939.52859.64388.5905</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -362,7 +369,7 @@
</tuple>
<state>
<tuple>
<float>1413882038.33</float>
<float>1419348765.01</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -131,8 +131,13 @@
});\n
})\n
\n
//////////////////////////////////////////////\n
// acquired method\n
//////////////////////////////////////////////\n
.declareAcquiredMethod("translateElementList", "translateElementList")\n
.declareAcquiredMethod("pleasePublishMyState", "pleasePublishMyState")\n
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n
\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
......@@ -154,6 +159,8 @@
widget_status_attribute: append_attribute || placeholder,\n
widget_status_class: append_class || placeholder\n
});\n
\n
return search_gadget.translateElementList(search_gadget.props.element);\n
})\n
\n
.declareMethod(\'getContent\', function () {\n
......@@ -312,7 +319,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
<value> <string>super_sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -326,7 +333,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>938.24816.20339.61866</string> </value>
<value> <string>939.52819.6586.23620</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -344,7 +351,7 @@
</tuple>
<state>
<tuple>
<float>1413819887.51</float>
<float>1419345824.09</float>
<string>GMT</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