Commit 2a242387 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

WIP slapos_jio: translate hostingjs site in Chinese

parent 80c5bf8f
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Title
data-i18n=Reference
data-i18n=Allocation Scope
data-i18n=Status
data-i18n=Servers
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.57354.18371.5888</string> </value>
<value> <string>980.36988.11538.20002</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508415987.5</float>
<float>1581615033.79</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -13,6 +13,7 @@
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("translate", "translate")
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
......@@ -57,30 +58,36 @@
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function (options) {
.declareMethod("render", function () {
var gadget = this,
default_strict_allocation_scope_uid,
lines_limit;
lines_limit,
servers_translation;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_list'),
gadget.getSetting("listbox_lines_limit", 20),
gadget.jio_get("portal_categories/allocation_scope/close/forever")
gadget.jio_get("portal_categories/allocation_scope/close/forever"),
gadget.translate("Title"),
gadget.translate("Reference"),
gadget.translate("Allocation Scope"),
gadget.translate("Status"),
gadget.translate("Servers")
]);
})
.push(function (result) {
lines_limit = result[0];
default_strict_allocation_scope_uid = result[1].uid;
return gadget.getDeclaredGadget('form_list');
})
.push(function (form_list) {
var column_list = [
['title', 'Title'],
['reference', 'Reference'],
['allocation_scope_title', 'Allocation Scope'],
['Computer_getNewsDict', 'Status']
];
['title', result[3]],
['reference', result[4]],
['allocation_scope_title', result[5]],
['Computer_getNewsDict', result[6]]
],
form_list = result[0];
lines_limit = result[1];
default_strict_allocation_scope_uid = result[2].uid;
servers_translation = result[7];
return form_list.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -99,7 +106,7 @@
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["title", "ascending"]],
"title": "Servers",
"title": servers_translation,
"type": "ListBox"
}
}},
......@@ -123,7 +130,7 @@
jio_key: "computer_module"
});
})
.push(function (result) {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: "change", options: {"page": "slap_add_computer"}}),
gadget.getUrlFor({command: "change", options: {page: "slap_computer_get_token"}}),
......@@ -133,7 +140,7 @@
})
.push(function (result) {
return gadget.updateHeader({
page_title: "Servers",
page_title: servers_translation,
token_url: result[1],
selection_url: result[2],
filter_action: true,
......
......@@ -231,7 +231,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.61498.11899.44253</string> </value>
<value> <string>980.3967.45207.31880</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +249,7 @@
</tuple>
<state>
<tuple>
<float>1554901061.9</float>
<float>1581614996.59</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Date
data-i18n=Price
data-i18n=Currency
data-i18n=Payment
data-i18n=Download
data-i18n=Invoices
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.57216.18037.29013</string> </value>
<value> <string>980.36988.11538.20002</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508407708.9</float>
<float>1581614039.46</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -12,6 +12,7 @@
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("translate", "translate")
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
......@@ -92,26 +93,35 @@
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function (options) {
.declareMethod("render", function () {
var gadget = this,
lines_limit;
lines_limit,
invoices_translation;
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("listbox_lines_limit", 20);
})
.push(function (listbox_lines_limit) {
lines_limit = listbox_lines_limit;
return gadget.getDeclaredGadget('form_list');
return RSVP.all([
gadget.getDeclaredGadget('form_list'),
gadget.getSetting("listbox_lines_limit", 20),
gadget.translate("Date"),
gadget.translate("Price"),
gadget.translate("Currency"),
gadget.translate("Payment"),
gadget.translate("Download"),
gadget.translate("Invoices")
]);
})
.push(function (form_list) {
.push(function (result) {
var column_list = [
['start_date', 'Date'],
['total_price', 'Price'],
['resource_reference', 'Currency'],
['translated_simulation_state_title', 'Payment'],
['download', 'Download']
];
['start_date', result[2]],
['total_price', result[3]],
['resource_reference', result[4]],
['translated_simulation_state_title', result[5]],
['download', result[6]]
],
form_list = result[0];
lines_limit = result[1];
invoices_translation = result[7];
return form_list.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -130,7 +140,7 @@
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["creation_date", "descending"]],
"title": "Invoices",
"title": invoices_translation,
"type": "ListBox"
}
}},
......@@ -154,14 +164,14 @@
jio_key: "accounting_module"
});
})
.push(function (result) {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: "change", options: {"page": "slapos"}})
]);
})
.push(function (result) {
return gadget.updateHeader({
page_title: "Invoices",
page_title: invoices_translation,
selection_url: result[0],
filter_action: true
});
......
......@@ -231,7 +231,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.61498.36227.27835</string> </value>
<value> <string>981.53734.45184.6621</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +249,7 @@
</tuple>
<state>
<tuple>
<float>1554901051.44</float>
<float>1581613848.42</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Title
data-i18n=Reference
data-i18n=Status
data-i18n=Networks
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.57355.44771.45687</string> </value>
<value> <string>980.36988.11538.20002</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508416076.67</float>
<float>1581615268.76</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -12,6 +12,7 @@
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("translate", "translate")
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
......@@ -55,24 +56,31 @@
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function (options) {
.declareMethod("render", function () {
var gadget = this,
lines_limit;
lines_limit,
networks_translation;
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("listbox_lines_limit", 20);
})
.push(function (listbox_lines_limit) {
lines_limit = listbox_lines_limit;
return gadget.getDeclaredGadget('form_list');
return RSVP.all([
gadget.getDeclaredGadget('form_list'),
gadget.getSetting("listbox_lines_limit", 20),
gadget.translate("Title"),
gadget.translate("Reference"),
gadget.translate("Status"),
gadget.translate("Networks")
]);
})
.push(function (form_list) {
.push(function (result) {
var column_list = [
['title', 'Title'],
['reference', 'Reference'],
['ComputerNetwork_getNewsDict', 'Status']
];
['title', result[2]],
['reference', result[3]],
['ComputerNetwork_getNewsDict', result[4]]
],
form_list = result[0];
lines_limit = result[1];
networks_translation = result[5];
return form_list.render({
erp5_document: {
"_embedded": {"_view": {
......@@ -92,7 +100,7 @@
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["reference", "ascending"]],
"title": "Networks",
"title": networks_translation,
"type": "ListBox"
}
}},
......@@ -116,7 +124,7 @@
jio_key: "computer_network_module"
});
})
.push(function (result) {
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: "change", options: {"page": "slap_add_network"}}),
gadget.getUrlFor({command: "change", options: {"page": "slapos"}})
......@@ -124,7 +132,7 @@
})
.push(function (result) {
return gadget.updateHeader({
page_title: "Networks",
page_title: networks_translation,
filter_action: true,
selection_url: result[1],
add_url: result[0]
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.61513.15083.40157</string> </value>
<value> <string>981.53757.50718.33655</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1554901041.21</float>
<float>1581615233.75</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Data updated
data-i18n=Title
data-i18n=Email
data-i18n=Organisation
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.59091.25023.39253</string> </value>
<value> <string>980.36988.11538.20002</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1508520213.46</float>
<float>1581688268.04</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, jIO, Blob */
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, jIO, Blob) {
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
......@@ -17,6 +17,7 @@
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("translate", "translate")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -34,7 +35,7 @@
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, jio_key_value, len = result.data.total_rows;
var i, value, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.hasOwnProperty("title"))) {
value = result.data.rows[i].value.title;
......@@ -85,7 +86,10 @@
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data updated.', status: 'success'});
return gadget.translate('Data updated');
})
.push(function (result) {
return gadget.notifySubmitted({message: result, status: 'success'});
});
})
......@@ -94,26 +98,33 @@
})
.onStateChange(function () {
var gadget = this, data;
var gadget = this,
organisation_translation;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getSetting("hateoas_url")
gadget.getSetting("hateoas_url"),
gadget.translate("Title"),
gadget.translate("Email"),
gadget.translate("Reference"),
gadget.translate("Associated Persons"),
gadget.translate("Organisation")
]);
})
.push(function (result) {
var column_list = [
['title', 'Title'],
['default_email_text', 'Email']
],
['title', result[2]],
['default_email_text', result[3]]
],
editable = gadget.state.editable;
organisation_translation = result[6];
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Title",
"title": result[2],
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
......@@ -124,7 +135,7 @@
},
"my_reference": {
"description": "",
"title": "Reference",
"title": result[4],
"default": gadget.state.doc.reference,
"css_class": "",
"required": 1,
......@@ -150,7 +161,7 @@
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["title", "ascending"]],
"title": "Associated Persons",
"title": result[5],
"type": "ListBox"
}
}},
......@@ -183,7 +194,7 @@
.push(function (url_list) {
var header_dict = {
selection_url: url_list[1],
page_title: "Organisation : " + gadget.state.doc.title,
page_title: organisation_translation + ": " + gadget.state.doc.title,
delete_url: url_list[2],
invitation_url: url_list[3],
save_action: true
......@@ -194,4 +205,4 @@
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP, jIO, Blob));
\ No newline at end of file
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -231,7 +231,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.51816.56601.26897</string> </value>
<value> <string>981.55007.2386.62327</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +249,7 @@
</tuple>
<state>
<tuple>
<float>1562012361.29</float>
<float>1581692426.72</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Slapos
data-i18n=Password is different from confirmation
data-i18n=New User Login created
data-i18n=Login Name
data-i18n=Password
data-i18n=Confirm your Password
data-i18n=Add New User Login
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
......
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.3557.5699.51524</string> </value>
<value> <string>981.54798.39582.64972</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1559201605.46</float>
<float>1581688625.32</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,6 +15,7 @@
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("translate", "translate")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -31,17 +32,24 @@
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
return RSVP.all([
form_gadget.getContent(),
gadget.translate("Password is different from confirmation"),
gadget.translate("New User Login created")
]);
})
.push(function (content) {
var k;
.push(function (result) {
var k,
content = result[0];
for (k in content) {
if (k !== "password_confirmation") {
doc[k] = content[k];
}
if ((k === "password_confirmation") &&
(content.password !== content.password_confirmation)) {
return gadget.notifySubmitted({message: 'Password is different from confirmation', status: 'error'});
if (content.hasOwnProperty(k)) {
if (k !== "password_confirmation") {
doc[k] = content[k];
}
if ((k === "password_confirmation") &&
(content.password !== content.password_confirmation)) {
return gadget.notifySubmitted({message: result[1], status: 'error'});
}
}
}
return gadget.getSetting("hateoas_url")
......@@ -49,7 +57,7 @@
return gadget.jio_putAttachment(content.parent_relative_url,
hateoas_url + gadget.state.jio_key + "/Person_newLogin", doc)
.push(function () {
return gadget.notifySubmitted({message: 'New User Login created.', status: 'success'});
return gadget.notifySubmitted({message: result[2], status: 'success'});
})
.push(function () {
return gadget