diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js index 94607d9953b1a79572a7962db230b6d40082cf42..cfae0f5e3f69b89222546398be2373714a254ace 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js @@ -48,6 +48,7 @@ .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") .declareAcquiredMethod("getUrlParameter", "getUrlParameter") .declareAcquiredMethod("translateHtml", "translateHtml") + .declareAcquiredMethod("translate", "translate") .declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateConfiguration", "updateConfiguration") @@ -86,6 +87,7 @@ begin_date = new Date(1970, 1, 1); end_date = days_30; } + // XXX do not translate here ! search_criteria = '( translated_simulation_state_title: "' + seriesName + '" AND delivery.start_date: >= ' + begin_date.toISOString().slice(0, 10) + ' AND delivery.start_date: < ' + end_date.toISOString().slice(0, 10) + ' )'; } else { // Situation 2: Search Support Request without date. @@ -122,8 +124,7 @@ return gadget.changeState({ render: true - }) - .push(function () { + }).push(function () { return gadget.getDeclaredGadget("last") .push(function (listbox) { return listbox.render({ @@ -145,8 +146,8 @@ .push(function (hateoas_url) { return RSVP.all([gadget.jio_getAttachment( 'support_request_module', - hateoas_url + 'support_request_module' - + "/SupportRequest_getSupportRequestStatisticsAsJson" + hateoas_url + 'support_request_module' + + '/SupportRequest_getSupportRequestStatisticsAsJson' ), gadget.declareGadget( option_dict.graph_gadget, @@ -283,9 +284,9 @@ var gadget = this; return new RSVP.Queue() .push(function () { - var generate_rss_input = gadget.element.querySelectorAll("input")[1], + var generate_rss_input = gadget.element.querySelectorAll("input")[1], /* XXX class based selectors ! */ restore_filter_input = gadget.element.querySelectorAll("input")[2], - one = new RSVP.Queue().push(function () { + one = new RSVP.Queue().push(function (){ return promiseEventListener(generate_rss_input, "click", false); }).push(function () { generate_rss_input.disabled = true; @@ -299,10 +300,12 @@ ); }) .push(function (result) { - generate_rss_input.parentNode.href = result.restricted_access_url; - generate_rss_input.value = "RSS Link"; - generate_rss_input.disabled = false; - generate_rss_input.classList.remove("ui-disabled"); + return gadget.translate("RSS Link").push(function(translated_rss_link_message) { + generate_rss_input.parentNode.href = result.restricted_access_url; + generate_rss_input.value = translated_rss_link_message, // "RSS Link"; + generate_rss_input.disabled = false; + generate_rss_input.classList.remove("ui-disabled"); + }); }); }), two = loopEventListener(restore_filter_input, "click", false, function () { diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.html b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.html index 2c744b9feb04811282fb1af938f7c258286486ab..e99dec856b2d2c75464f034617877839e635d830 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.html +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.html @@ -28,7 +28,9 @@ {{/each}} {{else}} -

All work caught up!

+
+

All work caught up!

+
{{/if}} diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.xml index 0f4133ebb7e3170936a35a94301c09682e325795..17b94b983aac35f02013d9253125335ee7a313a4 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.xml +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_html.xml @@ -220,7 +220,7 @@ actor - zope + nicolas comment @@ -234,7 +234,7 @@ serial - 962.24219.1265.43878 + 964.57086.33771.28859 state @@ -252,7 +252,7 @@ - 1506514266.01 + 1522750119.58 UTC diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.js b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.js index 6c239f2a850163b13f94c1f776894c1b04321312..0a689918a01a6fbf0505af2d9b3cedd3a3f5ae20 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.js +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.js @@ -78,9 +78,12 @@ count: result_list[i][2] }); } - gadget.element.querySelector('.document_list').innerHTML = table_template({ + return gadget.translateHtml(table_template({ document_list: line_list - }); + })); + }) + .push(function (translated_html) { + gadget.element.querySelector('.document_list').innerHTML = translated_html; }); }); }(window, rJS, RSVP, Handlebars, Query)); \ No newline at end of file diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.xml index 5bbcfd9149bacfa1b40049c6cac38574c74d74ef..0478596b7defa854c0d1bb2a4e5ac8e36cb244de 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.xml +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_page_worklist_js.xml @@ -220,7 +220,7 @@ actor - zope + nicolas.wavrant comment @@ -252,7 +252,7 @@ - 1506505200.17 + 1506505208.17 UTC diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_data_js.js b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_data_js.js new file mode 100644 index 0000000000000000000000000000000000000000..70145efa5f003d1235d63dfdc3c9d2a1cc440021 --- /dev/null +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_data_js.js @@ -0,0 +1,65 @@ +/*globals window*/ +/*jslint indent: 2, nomen: true, maxlen: 100*/ +(function (window) { + "use strict"; + + window.translation_data = { + en: { + }, + fr: { + // XXX Change this to "Support Requests Dashboard" ? + "Customer Support Dashboard": "Tableau de bord des demandes d'assistance", + // XXX change this to "Submit new Support Request" + "Submit New Support Request": "Soumettre une nouvelle demande d'assistance", + "Generate RSS": "Générer un RSS", + "RSS Link": "Lien vers le RSS", + "Support Requests WorkList": "Worklists des demandes d'assistances", + + "Support Request Pipe": "Demande d'assistance en cours", + "Last Month Activity": "Activité du mois", + // English ? + "Restore Filter": "Réinitaliser le filtre", + // Count ? + "Number": "Nombre", + "Day": "Jour", + + "Home": "Accueil", + "Support Request": "Demande d'assistance", + "Support Requests": "Demandes d'assistance", + "Preferences": "Préférences", + "Logout": "Se déconnecter", + + /* workflow states */ + "Opened": "Ouvert", + "Submitted": "Soumis", + "Suspended": "Suspendu", + "Closed": "Terminé", + + "Post Comment": "Poster un commentaire", + "Comments": "Commentaires", + + + // Listbox / UI standard + "Select": "Sélectionner", + "Configure": "Configurer", + "Sort": "Trier", + "Include": "Inclure", + "Exclude": "Exclure", + "Records": "Enregistrements", + + "Views": "Vues", + "Export": "Exporter", + "Previous": "Précédent", + "Next": "Suivant", + "Editable": "Éditable", + + "Confirm": "Confirmer", + "Language": "Langue", + "Clone": "Dupliquer", + "Delete": "Supprimer", + "Save": "Sauvegarder", + "User": "Utilisateur" + } + }; + +}(window)); \ No newline at end of file diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_data_js.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_data_js.xml new file mode 100644 index 0000000000000000000000000000000000000000..f7aaef9c9c1b1414414a39dece3e681f0a463691 --- /dev/null +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_data_js.xml @@ -0,0 +1,318 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + content_md5 + + + + + + default_reference + gadget_supportrequest_translation_data.js + + + description + + + + + + id + gadget_supportrequest_translation_data_js + + + language + en + + + portal_type + Web Script + + + short_title + + + + + + title + Gadget Translation Data JS + + + version + 001 + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + ERP5TypeTestCase + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1536229955.3 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + ERP5TypeTestCase + + + comment + + + + + + error_message + + + + serial + 970.5274.3228.18517 + + + state + current + + + time + + + + + + + + + + + 1536230122.76 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + ERP5TypeTestCase + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1536229848.73 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_html.html b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_html.html new file mode 100644 index 0000000000000000000000000000000000000000..8d358825bae0ae6fc3a39d8ffb28f83b73b49889 --- /dev/null +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_html.html @@ -0,0 +1,19 @@ + + + + + + Translation Gadget + + + + + + + + + + + + + diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_html.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_html.xml new file mode 100644 index 0000000000000000000000000000000000000000..aeee12b1e71f3139c0b2e913776be32eeb864ea7 --- /dev/null +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_translation_html.xml @@ -0,0 +1,326 @@ + + + + + + + + + + _Access_contents_information_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + _Add_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _Change_local_roles_Permission + + + Assignor + Manager + + + + + _Modify_portal_content_Permission + + + Assignee + Assignor + Manager + + + + + _View_Permission + + + Anonymous + Assignee + Assignor + Associate + Auditor + Manager + + + + + content_md5 + + + + + + content_type + text/html + + + default_reference + gadget_supportrequest_translation.html + + + description + + + + + + id + gadget_supportrequest_translation_html + + + language + + + + + + portal_type + Web Page + + + short_title + + + + + + title + Gadget Translation + + + version + + + + + + workflow_history + + AAAAAAAAAAI= + + + + + + + + + + + + + data + + + + document_publication_workflow + + AAAAAAAAAAM= + + + + edit_workflow + + AAAAAAAAAAQ= + + + + processing_status_workflow + + AAAAAAAAAAU= + + + + + + + + + + + + + + + + + + + action + publish_alive + + + actor + ERP5TypeTestCase + + + comment + + + + error_message + + + + time + + + + + + + + + + + 1536230270.81 + UTC + + + + + + + validation_state + published_alive + + + + + + + + + + + + + + + + + action + edit + + + actor + ERP5TypeTestCase + + + comment + + + + + + error_message + + + + serial + 970.5275.65420.580 + + + state + current + + + time + + + + + + + + + + + 1536230179.2 + UTC + + + + + + + + + + + + + + + + + + + + + action + detect_converted_file + + + actor + ERP5TypeTestCase + + + comment + + + + error_message + + + + external_processing_state + converted + + + serial + 0.0.0.0 + + + time + + + + + + + + + + + 1536230133.33 + UTC + + + + + + + + + + + diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_site_module/erp5_officejs_support_request_ui.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_site_module/erp5_officejs_support_request_ui.xml index ee372db9fee761b36d3bc8e382280f84ab55a6d6..ffdbcfce88580688a60987b78d647d75efc0598f 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_site_module/erp5_officejs_support_request_ui.xml +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_site_module/erp5_officejs_support_request_ui.xml @@ -366,7 +366,7 @@ configuration_translation_gadget_url - gadget_translation.html + gadget_supportrequest_translation.html configuration_view_action_category diff --git a/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test.xml b/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test.xml new file mode 100644 index 0000000000000000000000000000000000000000..8d8bd39e1d61bb1f8e720d360014e700dcd65a01 --- /dev/null +++ b/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test.xml @@ -0,0 +1,26 @@ + + + + + + + + + + _objects + + + + + + id + zz_translation_test + + + title + Tests which change language to french (running at the end) + + + + + diff --git a/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test/test000ChangeLanguage.xml b/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test/test000ChangeLanguage.xml new file mode 100644 index 0000000000000000000000000000000000000000..d540c4f0b2b7140608b0a29cec8633cef03cb853 --- /dev/null +++ b/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test/test000ChangeLanguage.xml @@ -0,0 +1,58 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + name_subpath + traverse_subpath + + + + + + + + + + + content_type + text/html + + + expand + 0 + + + id + test000ChangeLanguage + + + output_encoding + utf-8 + + + title + + + + + + diff --git a/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test/test000ChangeLanguage.zpt b/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test/test000ChangeLanguage.zpt new file mode 100644 index 0000000000000000000000000000000000000000..0cde711a6e0c31feccdfc3a346a714d8e291b540 --- /dev/null +++ b/bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/zz_translation_test/test000ChangeLanguage.zpt @@ -0,0 +1,73 @@ + + + The title + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Worklists on support request front page support translation
open${base_url}/web_site_module/erp5_officejs_support_request_ui/
waitForElementPresent//button[@name="panel"]
click//button[@name="panel"]
waitForElementPresent//a[@data-i18n="Preferences"]
click//a[@data-i18n="Preferences"]
waitForElementPresentfield_language
typefield_languagefr
click//button[@data-i18n="Save"]
waitForElementPresent//a[@data-i18n="Home" and text()="Accueil"]
assertText//a[@data-i18n="Preferences"]Préférences
+ + \ No newline at end of file diff --git a/bt5/erp5_officejs_support_request_ui_test/bt/dependency_list b/bt5/erp5_officejs_support_request_ui_test/bt/dependency_list index 83577141fab308e708f74b3050ef06eb534bd592..ca91404a287edf1d7f797f3d05d2230b4fd487da 100644 --- a/bt5/erp5_officejs_support_request_ui_test/bt/dependency_list +++ b/bt5/erp5_officejs_support_request_ui_test/bt/dependency_list @@ -2,4 +2,5 @@ erp5_ui_test_core erp5_ui_test erp5_web_renderjs_ui erp5_officejs_support_request_ui -erp5_web_renderjs_ui_test \ No newline at end of file +erp5_web_renderjs_ui_test +erp5_l10n_fr \ No newline at end of file