Added comments component translation.

This commit is contained in:
Pierre HUBERT 2018-08-05 16:29:49 +02:00
parent 4b7008b5ba
commit 81ba811622
5 changed files with 33 additions and 12 deletions

View File

@ -25,7 +25,7 @@ ComunicWeb.components.comments.actions = {
//Check for errors //Check for errors
if(result.error){ if(result.error){
ComunicWeb.common.notificationSystem.showNotification("Couldn't get informations about a comment !", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("comments_actions_err_get_info_single"), "danger");
return; return;
} }

View File

@ -26,7 +26,7 @@ ComunicWeb.components.comments.editor = {
//Check for error //Check for error
if(result.error){ if(result.error){
ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to update comment content !", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("comments_editor_err_update"), "danger");
return; return;
} }
@ -39,8 +39,8 @@ ComunicWeb.components.comments.editor = {
//Prompt the user to enter the new content of the comment //Prompt the user to enter the new content of the comment
ComunicWeb.common.messages.inputString( ComunicWeb.common.messages.inputString(
"Edit comment content", lang("comments_editor_title"),
"Please specify the new content of the comment: ", lang("comments_editor_notice"),
infos.content, infos.content,
inputCallback inputCallback
); );

View File

@ -46,7 +46,7 @@ ComunicWeb.components.comments.form = {
type: "input", type: "input",
elemType: "text", elemType: "text",
class: "form-control", class: "form-control",
placeholder: "New comment...", placeholder: lang("comments_form_input_placeholder"),
name: "content" name: "content"
}); });
newCommentText.maxLength = 255; newCommentText.maxLength = 255;
@ -106,7 +106,7 @@ ComunicWeb.components.comments.form = {
appendTo: buttonsGroup, appendTo: buttonsGroup,
type: "button", type: "button",
class: "btn btn-default btn-flat", class: "btn btn-default btn-flat",
innerHTML: "Send" innerHTML: lang("comments_form_send")
}); });
//Catch form when submitted //Catch form when submitted
@ -117,7 +117,7 @@ ComunicWeb.components.comments.form = {
//Check the comment //Check the comment
if(!hasImage && newCommentText.value < 5){ if(!hasImage && newCommentText.value < 5){
ComunicWeb.common.notificationSystem.showNotification("Please type a valid comment! (at least 5 characters)", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("comments_form_err_invalid_comment"), "danger");
return false; return false;
} }
@ -140,7 +140,7 @@ ComunicWeb.components.comments.form = {
//Check for errors //Check for errors
if(result.error){ if(result.error){
ComunicWeb.common.notificationSystem.showNotification("Couldn't create comment! (check its content)", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("comments_form_err_create_comment"), "danger");
return; return;
} }

View File

@ -23,7 +23,7 @@ ComunicWeb.components.comments.ui = {
//Check for errors //Check for errors
if(result.error){ if(result.error){
ComunicWeb.common.notificationSystem.showNotification("Couldn't informations about some users to display their comments !", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("comments_ui_err_get_users_info"), "danger");
return; return;
} }
@ -75,7 +75,7 @@ ComunicWeb.components.comments.ui = {
//Check for errors //Check for errors
if(result.error){ if(result.error){
ComunicWeb.common.notificationSystem.showNotification("Couldn't get informations about a user!", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("comments_ui_err_get_user_info"), "danger");
return; return;
} }
@ -191,7 +191,7 @@ ComunicWeb.components.comments.ui = {
//Make delete button lives //Make delete button lives
deleteCommentLink.onclick = function(){ deleteCommentLink.onclick = function(){
ComunicWeb.common.messages.confirm("Are you sure do you want to delete this comment ? This operation is unrecoverable!", function(response){ ComunicWeb.common.messages.confirm(lang("comments_ui_confirm_delete"), function(response){
//Check if user cancelled the operation //Check if user cancelled the operation
if(!response) if(!response)
@ -207,7 +207,7 @@ ComunicWeb.components.comments.ui = {
//Check for errors //Check for errors
if(response.error){ if(response.error){
ComunicWeb.common.notificationSystem.showNotification("Could not delete comment!", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("comments_ui_err_delete_comment"), "danger");
return; return;
} }

View File

@ -111,6 +111,27 @@ ComunicWeb.common.langs.en = {
notifications_dropdown_no_notif_notice: "You do not have any notification yet.", notifications_dropdown_no_notif_notice: "You do not have any notification yet.",
//Comments - Actions
comments_actions_err_get_info_single: "Couldn't get informations about a comment !",
//Comments - Editor
comments_editor_err_update: "An error occured while trying to update comment content !",
comments_editor_title: "Edit comment content",
comments_editor_notice: "Please specify the new content of the comment: ",
//Comments - UI
comments_ui_err_get_users_info: "Couldn't information about some users to display their comments !",
comments_ui_err_get_user_info: "Couldn't get information about a user!",
comments_ui_confirm_delete: "Are you sure do you want to delete this comment ? This operation is unrecoverable!",
comments_ui_err_delete_comment: "Could not delete comment!",
//Comments - Form
comments_form_input_placeholder: "New comment...",
comments_form_send: "Send",
comments_form_err_invalid_comment: "Please type a valid comment! (at least 5 characters)",
comments_form_err_create_comment: "Couldn't create comment! (check its content)",
/** /**
* Pages * Pages
*/ */