From 52c963cf1bb7a2a2e22d0a93ff439e4815199849 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 4 Aug 2018 10:02:12 +0200 Subject: [PATCH] Translated notifications dropdown. --- assets/js/components/notifications/dropdown.js | 18 +++++++++--------- assets/js/langs/en.inc.js | 14 +++++++++++++- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/assets/js/components/notifications/dropdown.js b/assets/js/components/notifications/dropdown.js index 74897afb..7c83e2b2 100644 --- a/assets/js/components/notifications/dropdown.js +++ b/assets/js/components/notifications/dropdown.js @@ -68,7 +68,7 @@ ComunicWeb.components.notifications.dropdown = { appendTo: dropdownMenu, type: "li", class: "header", - innerHTML: "Notifications" + innerHTML: lang("notifications_dropdown_title") }); //Add notifications list @@ -93,13 +93,13 @@ ComunicWeb.components.notifications.dropdown = { var deleteAllLink = createElem2({ appendTo: dropdownBottom, type: "a", - innerHTML: "Delete all" + innerHTML: lang("notifications_dropdown_delete_all_link") }); //Make the delete all notifications link lives deleteAllLink.onclick = function(){ - ComunicWeb.common.messages.confirm("Are you sure do you want to delete all the notifications ? This operation can not be cancelled !", function(accept){ + ComunicWeb.common.messages.confirm(lang("notifications_dropdown_confirm_delete_all"), function(accept){ //We continue only if the user confirmed the operation if(!accept) @@ -110,12 +110,12 @@ ComunicWeb.components.notifications.dropdown = { //Check for errors if(result.error){ - ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to delete all the notifications !", "danger"); + ComunicWeb.common.notificationSystem.showNotification(lang("notifications_dropdown_err_delete_all_notifications"), "danger"); return; } //Display success - ComunicWeb.common.notificationSystem.showNotification("The entire list of notification has been cleared.", "success"); + ComunicWeb.common.notificationSystem.showNotification(lang("notifications_dropdown_delete_all_success"), "success"); }); @@ -150,7 +150,7 @@ ComunicWeb.components.notifications.dropdown = { //Check for errors if(result.error){ - ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to retrieve notifications list !", "danger"); + ComunicWeb.common.notificationSystem.showNotification(lang("notifications_dropdown_err_get_notifs_list"), "danger"); return; } @@ -162,7 +162,7 @@ ComunicWeb.components.notifications.dropdown = { //Check for errors if(users.error){ - ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to retrieve users informations for the notifications !", "danger"); + ComunicWeb.common.notificationSystem.showNotification(lang("notifications_dropdown_err_get_related_users_info"), "danger"); return; } @@ -172,7 +172,7 @@ ComunicWeb.components.notifications.dropdown = { //Check for errors if(groups.error) - return notify("Could not get groups information!", "danger"); + return notify(lang("notifications_dropdown_err_get_related_groups_info"), "danger"); //Empty the target list list.innerHTML = ""; @@ -188,7 +188,7 @@ ComunicWeb.components.notifications.dropdown = { //Display a message if there isn't any notification to display if(result.length == 0){ - list.innerHTML = "
  • You do not have any notification yet.
  • "; + list.innerHTML = "
  • " + lang("notifications_dropdown_no_notif_notice") + "
  • "; } diff --git a/assets/js/langs/en.inc.js b/assets/js/langs/en.inc.js index afbb8b34..ab6e7d53 100644 --- a/assets/js/langs/en.inc.js +++ b/assets/js/langs/en.inc.js @@ -81,13 +81,25 @@ ComunicWeb.common.langs.en = { like_btn_liking: "Liking", like_btn_like: "Like", - //Conversations dropdown + //Conversations - unread dropdown conversations_dropdown_header: "Unread conversations", conversations_dropdown_err_get_list: "Could not retrieve the list of unread conversations !", conversations_dropdown_err_get_user_info: "Could not get informations about some users !", conversations_dropdown_no_unread_notice: "You do not have any unread messages in the conversations you are following...", + //Notifications - dropdown + notifications_dropdown_title: "Notifications", + notifications_dropdown_delete_all_link: "Delete all", + notifications_dropdown_confirm_delete_all: "Are you sure do you want to delete all the notifications ? This operation can not be cancelled !", + notifications_dropdown_err_delete_all_notifications: "An error occured while trying to delete all the notifications !", + notifications_dropdown_delete_all_success: "The entire list of notification has been cleared.", + notifications_dropdown_err_get_notifs_list: "An error occured while trying to retrieve notifications list !", + notifications_dropdown_err_get_related_users_info: "An error occured while trying to retrieve users informations for the notifications !", + notifications_dropdown_err_get_related_groups_info: "Could not get groups information!", + notifications_dropdown_no_notif_notice: "You do not have any notification yet.", + + /** * Pages */