Translated post creation form

This commit is contained in:
Pierre 2018-03-11 17:12:08 +01:00
parent 0fab71c348
commit 401f26a922
3 changed files with 61 additions and 19 deletions

View File

@ -51,29 +51,29 @@ ComunicWeb.components.posts.form = {
}); });
//Text //Text
var textType = this._add_post_type(postTypesContener, "text", "Text"); var textType = this._add_post_type(postTypesContener, "text", lang("_post_type_text"));
textType.checked = true; textType.checked = true;
//Image //Image
var imageType = this._add_post_type(postTypesContener, "image", "<i class='fa fa-picture-o'></i> <span class='hidden-xs'>Image</span>"); var imageType = this._add_post_type(postTypesContener, "image", "<i class='fa fa-picture-o'></i> <span class='hidden-xs'>"+lang("_post_type_image")+"</span>");
//Youtube //Youtube
var youtubeType = this._add_post_type(postTypesContener, "youtube", "<i class='fa fa-youtube-play'></i> <span class='hidden-xs'>YouTube</span>"); var youtubeType = this._add_post_type(postTypesContener, "youtube", "<i class='fa fa-youtube-play'></i> <span class='hidden-xs'>"+lang("_post_type_youtube")+"</span>");
//Movie //Movie
var movieType = this._add_post_type(postTypesContener, "movie", "<i class='fa fa-file-movie-o'></i> <span class='hidden-xs'>Movie</span>"); var movieType = this._add_post_type(postTypesContener, "movie", "<i class='fa fa-file-movie-o'></i> <span class='hidden-xs'>"+lang("_post_type_movie")+"</span>");
//Link //Link
var linkType = this._add_post_type(postTypesContener, "link", "<i class='fa fa-link'></i> <span class='hidden-xs'>Weblink</span>"); var linkType = this._add_post_type(postTypesContener, "link", "<i class='fa fa-link'></i> <span class='hidden-xs'>"+lang("_post_type_link")+"</span>");
//PDF //PDF
var pdfType = this._add_post_type(postTypesContener, "pdf", "<i class='fa fa-file-pdf-o'></i> <span class='hidden-xs'>PDF</span>"); var pdfType = this._add_post_type(postTypesContener, "pdf", "<i class='fa fa-file-pdf-o'></i> <span class='hidden-xs'>"+lang("_post_type_pdf")+"</span>");
//Countdown timer //Countdown timer
var countdownType = this._add_post_type(postTypesContener, "countdown", "<i class='fa fa-clock-o'></i> <span class='hidden-xs'>Timer</span>"); var countdownType = this._add_post_type(postTypesContener, "countdown", "<i class='fa fa-clock-o'></i> <span class='hidden-xs'>"+lang("_post_type_countdown")+"</span>");
//Survey //Survey
var surveyType = this._add_post_type(postTypesContener, "survey", "<i class='fa fa-pie-chart'></i> <span class='hidden-xs'>Survey</span>"); var surveyType = this._add_post_type(postTypesContener, "survey", "<i class='fa fa-pie-chart'></i> <span class='hidden-xs'>"+lang("_post_type_survey")+"</span>");
@ -101,7 +101,7 @@ ComunicWeb.components.posts.form = {
var youtubeLinkInput = createFormGroup({ var youtubeLinkInput = createFormGroup({
target: youtubeInputForm, target: youtubeInputForm,
label: "Youtube video link", label: lang("_input_youtube_link_label"),
placeholder: "https://youtube.com/watch?v=", placeholder: "https://youtube.com/watch?v=",
type: "text" type: "text"
}); });
@ -120,7 +120,7 @@ ComunicWeb.components.posts.form = {
appendTo: movieInputForm, appendTo: movieInputForm,
type: "button", type: "button",
class: "btn btn-primary", class: "btn btn-primary",
innerHTML: "Choose" innerHTML: lang("_choose")
}); });
var movieIDInput = createElem2({ var movieIDInput = createElem2({
@ -133,7 +133,7 @@ ComunicWeb.components.posts.form = {
var movieName = createElem2({ var movieName = createElem2({
appendTo: movieInputForm, appendTo: movieInputForm,
type: "span", type: "span",
innerHTML: "No movie selected." innerHTML: lang("_no_movie_selected")
}); });
//Make movie choose button lives //Make movie choose button lives
@ -155,7 +155,7 @@ ComunicWeb.components.posts.form = {
var linkInput = createFormGroup({ var linkInput = createFormGroup({
target: linkChooseForm, target: linkChooseForm,
label: "Page URL", label: lang("_input_page_url_label"),
placeholder: "https://...", placeholder: "https://...",
type: "text" type: "text"
}); });
@ -184,7 +184,7 @@ ComunicWeb.components.posts.form = {
var timeEndInput = createFormGroup({ var timeEndInput = createFormGroup({
target: countdownForm, target: countdownForm,
label: "End date", label: lang("_input_countdown_enddate"),
placeholder: "dd/mm/yyyy", placeholder: "dd/mm/yyyy",
type: "text" type: "text"
}); });
@ -205,15 +205,15 @@ ComunicWeb.components.posts.form = {
//Survey question //Survey question
var surveyQuestionInput = createFormGroup({ var surveyQuestionInput = createFormGroup({
target: surveyForm, target: surveyForm,
label: "Question for the survey", label: lang("_input_survey_question_label"),
placeholder: "Question", placeholder: lang("_input_survey_question_placeholder"),
type: "text" type: "text"
}); });
//Survey answers //Survey answers
var surveyAnswerInput = createFormGroup({ var surveyAnswerInput = createFormGroup({
target: surveyForm, target: surveyForm,
label: "Answers", label: lang("_input_survey_answers_label"),
type: "select2", type: "select2",
multiple: true, multiple: true,
}); });
@ -222,7 +222,7 @@ ComunicWeb.components.posts.form = {
var surveyAnswerHelper = createElem2({ var surveyAnswerHelper = createElem2({
appendTo: surveyForm, appendTo: surveyForm,
type: "p", type: "p",
innerHTML: "Type your answer and then press return (enter) key to confirm it." innerHTML: lang("_input_survey_answers_hint"),
}) })
//Enable select2 //Enable select2
@ -287,7 +287,7 @@ ComunicWeb.components.posts.form = {
appendTo: rightDiv, appendTo: rightDiv,
type: "button", type: "button",
class: "btn btn-primary", class: "btn btn-primary",
innerHTML: "Send" innerHTML: lang("_send")
}); });
//Make send button lives //Make send button lives
@ -302,7 +302,7 @@ ComunicWeb.components.posts.form = {
//Check if the message includes an image //Check if the message includes an image
if(message_content.includes("data:image/")){ if(message_content.includes("data:image/")){
ComunicWeb.common.notificationSystem.showNotification("Please do not drag images directly in the message !", "danger"); ComunicWeb.common.notificationSystem.showNotification(lang("_err_drag_image_post"), "danger");
return; return;
} }

View File

@ -7,6 +7,8 @@ ComunicWeb.common.langs.en = {
//Really really common messages //Really really common messages
_loading: "Loading...", _loading: "Loading...",
_send: "Send",
_choose: "Choisir",
//Error messages //Error messages
"__fatal_error": "Fatal error", "__fatal_error": "Fatal error",
@ -32,5 +34,24 @@ ComunicWeb.common.langs.en = {
_menu_bar_action_logout: "Logout", _menu_bar_action_logout: "Logout",
//Posts form //Posts form
_post_type_text: "Text",
_post_type_youtube: "Youtube",
_post_type_image: "Image",
_post_type_movie: "Movie",
_post_type_link: "Weblink",
_post_type_pdf: "PDF",
_post_type_countdown: "Timer",
_post_type_survey: "Survey",
_input_youtube_link_label: "Youtube video link",
_no_movie_selected: "No movie selected.",
_input_page_url_label: "Page URL",
_input_countdown_enddate: "End date",
_input_survey_question_label: "Question for the survey",
_input_survey_question_placeholder: "Question",
_input_survey_answers_label: "Answers",
_input_survey_answers_hint: "Type your answer and then press return (enter) key to confirm it.",
_err_drag_image_post: "Please do not drag images directly in the message !",
} }

View File

@ -7,6 +7,7 @@ ComunicWeb.common.langs.fr = {
//Really really common messages //Really really common messages
_loading: "Chargement...", _loading: "Chargement...",
_send: "Envoyer",
//Error messages //Error messages
"__fatal_error": "Erreur fatale", "__fatal_error": "Erreur fatale",
@ -31,4 +32,24 @@ ComunicWeb.common.langs.fr = {
_menu_bar_search_placeholder: "Recherche...", _menu_bar_search_placeholder: "Recherche...",
_menu_bar_action_logout: "Déconnexion", _menu_bar_action_logout: "Déconnexion",
//Posts form
_post_type_text: "Texte",
_post_type_youtube: "Youtube",
_post_type_image: "Image",
_post_type_movie: "Vidéos",
_post_type_link: "Lien web",
_post_type_pdf: "PDF",
_post_type_countdown: "Compteur à rebours",
_post_type_survey: "Sondage",
_input_youtube_link_label: "Lien de la vidéo YouTube",
_no_movie_selected: "Aucune vidéo sélectionnée.",
_input_page_url_label: "URL de la page",
_input_countdown_enddate: "Date de fin",
_input_survey_question_label: "Question du sondage",
_input_survey_question_placeholder: "Question",
_input_survey_answers_label: "Réponses",
_input_survey_answers_hint: "Saisissez vos réponses une par une. Appuyer sur entrée après avoir saisi une réponse pour la confirmer.",
_err_drag_image_post: "Veuillez ne pas glisser d'images dans les messages !",
} }