Translated post UI.

This commit is contained in:
Pierre HUBERT 2018-08-05 16:13:48 +02:00
parent 52c963cf1b
commit 02744d5c72
2 changed files with 20 additions and 9 deletions

View File

@ -112,7 +112,7 @@ ComunicWeb.components.posts.ui = {
getMultipleUsersInfos(usersToFetch, function(result){ getMultipleUsersInfos(usersToFetch, function(result){
if(result.error) { if(result.error) {
ComunicWeb.debug.logMessage("Could not get some users info!"); ComunicWeb.debug.logMessage("Could not get some users info!");
userName.innerHTML = "Error"; userName.innerHTML = lang("posts_ui_error");
return; return;
} }
@ -259,7 +259,7 @@ ComunicWeb.components.posts.ui = {
//Check for errors //Check for errors
if(response.error){ if(response.error){
ComunicWeb.common.notificationSystem.showNotification("Couldn't change post visibility level !", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("posts_ui_err_update_visibility"), "danger");
return; return;
} }
@ -326,7 +326,7 @@ ComunicWeb.components.posts.ui = {
deleteButtonLink.onclick = function(){ deleteButtonLink.onclick = function(){
//Create a confirmation dialog //Create a confirmation dialog
ComunicWeb.common.messages.confirm("Are you sure do you want to delete this post? The operation can not be reverted !", function(accept){ ComunicWeb.common.messages.confirm(lang("posts_ui_confirm_delete"), function(accept){
//Check if the user cancelled the operation //Check if the user cancelled the operation
if(!accept) if(!accept)
@ -341,7 +341,7 @@ ComunicWeb.components.posts.ui = {
if(response.error){ if(response.error){
//Display an error //Display an error
ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to delete post !", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("posts_ui_err_delete_post"), "danger");
//Make the post visible //Make the post visible
postRoot.style.visibility = "visible"; postRoot.style.visibility = "visible";
@ -700,20 +700,20 @@ ComunicWeb.components.posts.ui = {
appendTo: surveyResponse, appendTo: surveyResponse,
class: "survey-given-response", class: "survey-given-response",
type: "p", type: "p",
innerHTML: "Your response: " + info.data_survey.choices[info.data_survey.user_choice].name + " " innerHTML: lang("posts_ui_survey_your_response", [info.data_survey.choices[info.data_survey.user_choice].name])
}); });
//Offer the user to cancel his choice //Offer the user to cancel his choice
var cancelReponseLink = createElem2({ var cancelReponseLink = createElem2({
appendTo: choosedResponseElem, appendTo: choosedResponseElem,
type: "a", type: "a",
innerHTML: "Cancel" innerHTML: lang("posts_ui_cance_response_survey")
}); });
//Make cancel button lives //Make cancel button lives
cancelReponseLink.onclick = function(){ cancelReponseLink.onclick = function(){
ComunicWeb.common.messages.confirm("Do you really want to cancel your response to the survey ?", function(confirm){ ComunicWeb.common.messages.confirm(lang("posts_ui_confirm_cancel_survey_response"), function(confirm){
//Check if the user cancelled //Check if the user cancelled
if(!confirm) if(!confirm)
@ -724,7 +724,7 @@ ComunicWeb.components.posts.ui = {
//Check for errors //Check for errors
if(response.error){ if(response.error){
ComunicWeb.common.notificationSystem.showNotification("Could not cancel response to survey !", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("posts_ui_err_cancel_response_survey"), "danger");
return; return;
} }
@ -778,7 +778,7 @@ ComunicWeb.components.posts.ui = {
appendTo: chooseButtonSpan, appendTo: chooseButtonSpan,
type: "button", type: "button",
class: "btn btn-default", class: "btn btn-default",
innerHTML: "Send" innerHTML: lang("posts_ui_send_survey_response")
}); });
//Make confirm button lives //Make confirm button lives

View File

@ -35,6 +35,17 @@ ComunicWeb.common.langs.en = {
menu_bar_action_settings: "Settings", menu_bar_action_settings: "Settings",
_menu_bar_action_logout: "Logout", _menu_bar_action_logout: "Logout",
//Posts - UI
posts_ui_error: "Error",
posts_ui_err_update_visibility: "Couldn't change post visibility level !",
posts_ui_confirm_delete: "Are you sure do you want to delete this post? The operation can not be reverted !",
posts_ui_err_delete_post: "An error occured while trying to delete post !",
posts_ui_survey_your_response: "Your response: %p ",
posts_ui_confirm_cancel_survey_response: "Do you really want to cancel your response to the survey ?",
posts_ui_err_cancel_response_survey: "Could not cancel response to survey !",
posts_ui_send_survey_response: "Send",
posts_ui_cance_response_survey: "Cancel",
//Posts form //Posts form
_post_type_text: "Text", _post_type_text: "Text",
_post_type_youtube: "Youtube", _post_type_youtube: "Youtube",