From 7c493839205acb0b204565158975822c694143f6 Mon Sep 17 00:00:00 2001 From: Rafael Monnerat <rafael@nexedi.com> Date: Thu, 26 Dec 2019 21:59:27 +0000 Subject: [PATCH] slapos_jio: Translate Payment Result page into Chinese. --- .../rjs_gadget_slapos_payment_result_js_zh.js | 112 ++++++ ...rjs_gadget_slapos_payment_result_js_zh.xml | 321 ++++++++++++++++++ ..._keep_last_workflow_history_only_path_list | 2 +- master/bt5/slapos_jio/bt/template_path_list | 2 +- 4 files changed, 435 insertions(+), 2 deletions(-) create mode 100644 master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js_zh.js create mode 100644 master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js_zh.xml diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js_zh.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js_zh.js new file mode 100644 index 000000000..20c7f6fa3 --- /dev/null +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js_zh.js @@ -0,0 +1,112 @@ +/*jslint nomen: true, indent: 2, maxlen: 80 */ +/*global window, rJS, RSVP, Handlebars */ +(function (window, rJS, RSVP, Handlebars) { + "use strict"; + var gadget_klass = rJS(window), + message_source = gadget_klass.__template_element + .getElementById("message-template") + .innerHTML, + message_template = Handlebars.compile(message_source); + + ///////////////////////////// + // parameters + ///////////////////////////// + + ///////////////////////////// + // methods + ///////////////////////////// + gadget_klass + + ///////////////////////////// + // state + ///////////////////////////// + + ///////////////////////////// + // ready + ///////////////////////////// + + ///////////////////////////// + // acquired methods + ///////////////////////////// + + ///////////////////////////// + // published methods + ///////////////////////////// + + ///////////////////////////// + // declared methods + ///////////////////////////// + + // -------------------.--- Render ------------------------------------------ + .declareMethod("render", function (my_option_dict) { + var gadget = this, + result = window.location.hash.replace("#payment_", "").split("?")[0], + payment = window.location.hash.split("payment=")[1]; + + return gadget.getElement() + .push(function (element) { + var message, advice, page_title, payment_message = "", + payment_reference = "", payment_message_footer = ""; +聽 聽 聽 聽 聽 if (result === "success") { +聽 聽 聽 聽 聽 聽 page_title = "鎰熻阿鎮ㄧ殑浠樻"; +聽 聽 聽 聽 聽 聽 message = "鎮ㄧ殑璁㈠崟宸叉垚鍔熺敓鎴愩€�"; +聽 聽 聽 聽 聽 聽 advice = "寰呮垜浠粠閾惰鏀跺埌浠樻纭涔﹀悗锛屾偍灏嗘敹鍒颁竴灏佺數瀛愰偖浠讹紝鍏朵腑鍖呭惈鏈夊叧鎵€璁㈣喘鏈嶅姟鍣ㄧ殑璇︾粏璇存槑鍜屼俊鎭€�"; +聽 聽 聽 聽 聽 聽 payment_message = "鎮ㄧ殑鏀粯鍗曞彿鏄�"; +聽 聽 聽 聽 聽 聽 payment_reference = payment.split("/")[1]; +聽 聽 聽 聽 聽 聽 payment_message_footer = "濡傛灉鎮ㄦ湁浠讳綍鐤戦棶鎴栧湪鎺ヤ笅鏉ョ殑24灏忔椂鍐呮湭鏀跺埌浠讳綍淇℃伅锛岃閫氳繃浠ヤ笅鏂瑰紡涓庢垜浠仈绯�"; +聽 聽 聽 聽 聽 } else if (result === "cancel") { +聽 聽 聽 聽 聽 聽 page_title = "浠樻宸插彇娑�"; +聽 聽 聽 聽 聽 聽 message = "鎮ㄥ凡鍙栨秷浠樻娴佺▼銆�"; +聽 聽 聽 聽 聽 聽 advice = "濡傛灉鎮ㄨ缁х画杩涜棰勮锛岃鑰冭檻閲嶆柊鍚姩璇ユ祦绋嬨€�"; +聽 聽 聽 聽 聽 } else if (result === "error") { +聽 聽 聽 聽 聽 聽 page_title = "浠樻鍑洪敊浜�"; +聽 聽 聽 聽 聽 聽 message = "浠樻鏃跺彂鐢熼敊璇€�"; +聽 聽 聽 聽 聽 聽 advice = "璇风◢鍚庡啀璇曪紝鎴栭€氳繃浠ヤ笅鍦板潃涓庢垜浠仈绯汇€�"; +聽 聽 聽 聽 聽 } else if (result === "refused" || result === "referral") { +聽 聽 聽 聽 聽 聽 page_title = "浠樻琚嫆缁�"; +聽 聽 聽 聽 聽 聽 message = "寰堟姳姝夛紝璇ユ敮浠樺凡琚粯娆剧郴缁熸嫆缁�"; +聽 聽 聽 聽 聽 聽 advice = "璇蜂笌鎮ㄧ殑閾惰鑱旂郴鎴栦娇鐢ㄥ叾浠栦俊鐢ㄥ崱銆�"; + payment_message_footer = "濡傛湁浠讳綍鐤戦棶锛岃閫氳繃浠ヤ笅鏂瑰紡涓庢垜浠仈绯�"; +聽 聽 聽 聽 聽 } else if (result === "return") { +聽 聽 聽 聽 聽 聽 page_title = "浠樻鏈畬鎴�"; +聽 聽 聽 聽 聽 聽 message = "鎮ㄥ皻鏈畬鎴愪粯娆俱€�"; +聽 聽 聽 聽 聽 聽 advice = "濡傛灉瑕佺户缁璁紝璇疯€冭檻閲嶆柊鍚姩娴佺▼銆�"; + payment_message_footer = "濡傛湁浠讳綍鐤戦棶锛岃閫氳繃浠ヤ笅鏂瑰紡涓庢垜浠仈绯�"; +聽 聽 聽 聽 聽 } else if (result === "already_registered") { +聽 聽 聽 聽 聽 聽 page_title = "浠樻璁板綍宸茬敓鎴�"; +聽 聽 聽 聽 聽 聽 message = "鎮ㄧ殑浠樻璁板綍宸茬敓鎴愩€� 濡傛灉鎮ㄥ姝や粯娆炬湁浠讳綍鐤戦棶锛岃涓庢垜浠仈绯汇€�"; +聽 聽 聽 聽 聽 聽 payment_message_footer = "濡傛灉鎮ㄦ湁浠讳綍鐤戦棶鎴栧湪鎺ヤ笅鏉ョ殑24灏忔椂鍐呮湭鏀跺埌浠讳綍淇℃伅锛岃閫氳繃浠ヤ笅鏂瑰紡涓庢垜浠仈绯�"; +聽 聽 聽 聽 聽 } else { +聽 聽 聽 聽 聽 聽 throw new Error("Unknown action to take: " + result); +聽 聽 聽 聽 聽 } + element.innerHTML = message_template({ + page_title: page_title, + message_to_acknowledge: message, + advice: advice, + payment_message_header: payment_message, + payment_reference: payment_reference, + payment_message_footer: payment_message_footer + }); + return page_title; + }); + }) + + ///////////////////////////// + // declared jobs + ///////////////////////////// + + ///////////////////////////// + // declared service + ///////////////////////////// + .declareService(function () { + var gadget = this; + return new RSVP.Queue() + .push(function () { + return gadget.render({}); + }); + }); + ///////////////////////////// + // on Event + ///////////////////////////// + +}(window, rJS, RSVP, Handlebars)); \ No newline at end of file diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js_zh.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js_zh.xml new file mode 100644 index 000000000..f14311e23 --- /dev/null +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js_zh.xml @@ -0,0 +1,321 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Web Script" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Access_contents_information_Permission</string> </key> + <value> + <tuple> + <string>Anonymous</string> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Change_local_roles_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_View_Permission</string> </key> + <value> + <tuple> + <string>Anonymous</string> + <string>Assignee</string> + <string>Assignor</string> + <string>Associate</string> + <string>Auditor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>content_md5</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>gadget_slapos_payment_result.js</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>rjs_gadget_slapos_payment_result_js_zh</string> </value> + </item> + <item> + <key> <string>language</string> </key> + <value> <string>zh</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Web Script</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Gadget SlapOS Site invoice State</string> </value> + </item> + <item> + <key> <string>version</string> </key> + <value> <string>001</string> </value> + </item> + <item> + <key> <string>workflow_history</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary> + <item> + <key> <string>document_publication_workflow</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>edit_workflow</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + <item> + <key> <string>processing_status_workflow</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> + </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> + </pickle> + <pickle> + <tuple> + <none/> + <list> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> <string>publish_alive</string> </value> + </item> + <item> + <key> <string>actor</string> </key> + <value> <string>zope</string> </value> + </item> + <item> + <key> <string>comment</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>error_message</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>time</string> </key> + <value> + <object> + <klass> + <global name="DateTime" module="DateTime.DateTime"/> + </klass> + <tuple> + <none/> + </tuple> + <state> + <tuple> + <float>1577390176.2</float> + <string>UTC</string> + </tuple> + </state> + </object> + </value> + </item> + <item> + <key> <string>validation_state</string> </key> + <value> <string>published_alive</string> </value> + </item> + </dictionary> + </list> + <none/> + </tuple> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> + </pickle> + <pickle> + <tuple> + <none/> + <list> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> <string>edit</string> </value> + </item> + <item> + <key> <string>actor</string> </key> + <value> <string>zope</string> </value> + </item> + <item> + <key> <string>comment</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>error_message</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>serial</string> </key> + <value> <string>980.48874.43539.21111</string> </value> + </item> + <item> + <key> <string>state</string> </key> + <value> <string>current</string> </value> + </item> + <item> + <key> <string>time</string> </key> + <value> + <object> + <klass> + <global name="DateTime" module="DateTime.DateTime"/> + </klass> + <tuple> + <none/> + </tuple> + <state> + <tuple> + <float>1577390152.17</float> + <string>UTC</string> + </tuple> + </state> + </object> + </value> + </item> + </dictionary> + </list> + <none/> + </tuple> + </pickle> + </record> + <record id="5" aka="AAAAAAAAAAU="> + <pickle> + <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> + </pickle> + <pickle> + <tuple> + <none/> + <list> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> <string>detect_converted_file</string> </value> + </item> + <item> + <key> <string>actor</string> </key> + <value> <string>zope</string> </value> + </item> + <item> + <key> <string>comment</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>error_message</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_processing_state</string> </key> + <value> <string>converted</string> </value> + </item> + <item> + <key> <string>serial</string> </key> + <value> <string>0.0.0.0</string> </value> + </item> + <item> + <key> <string>time</string> </key> + <value> + <object> + <klass> + <global name="DateTime" module="DateTime.DateTime"/> + </klass> + <tuple> + <none/> + </tuple> + <state> + <tuple> + <float>1577390023.93</float> + <string>UTC</string> + </tuple> + </state> + </object> + </value> + </item> + </dictionary> + </list> + <none/> + </tuple> + </pickle> + </record> +</ZopeData> diff --git a/master/bt5/slapos_jio/bt/template_keep_last_workflow_history_only_path_list b/master/bt5/slapos_jio/bt/template_keep_last_workflow_history_only_path_list index bbbebe7de..7f32cd852 100644 --- a/master/bt5/slapos_jio/bt/template_keep_last_workflow_history_only_path_list +++ b/master/bt5/slapos_jio/bt/template_keep_last_workflow_history_only_path_list @@ -187,7 +187,7 @@ web_page_module/rjs_gadget_slapos_network_status_html web_page_module/rjs_gadget_slapos_network_status_js web_page_module/rjs_gadget_slapos_panel_html web_page_module/rjs_gadget_slapos_panel_js -web_page_module/rjs_gadget_slapos_payment_result_js +web_page_module/rjs_gadget_slapos_payment_result_js** web_page_module/rjs_gadget_slapos_project_status_html web_page_module/rjs_gadget_slapos_project_status_js web_page_module/rjs_gadget_slapos_site_status_html diff --git a/master/bt5/slapos_jio/bt/template_path_list b/master/bt5/slapos_jio/bt/template_path_list index e9f693016..afe21e6ce 100644 --- a/master/bt5/slapos_jio/bt/template_path_list +++ b/master/bt5/slapos_jio/bt/template_path_list @@ -187,7 +187,7 @@ web_page_module/rjs_gadget_slapos_network_status_html web_page_module/rjs_gadget_slapos_network_status_js web_page_module/rjs_gadget_slapos_panel_html web_page_module/rjs_gadget_slapos_panel_js -web_page_module/rjs_gadget_slapos_payment_result_js +web_page_module/rjs_gadget_slapos_payment_result_js** web_page_module/rjs_gadget_slapos_project_status_html web_page_module/rjs_gadget_slapos_project_status_js web_page_module/rjs_gadget_slapos_site_status_html -- 2.30.9