Commit 5ab95409 authored by Quentin Grimaud's avatar Quentin Grimaud Committed by Stéphane Glondu
Browse files

complete homogeneisation of responsive booth i18n keys

parent 91f60b67
Pipeline #270670 passed with stage
in 40 minutes and 40 seconds
......@@ -8,7 +8,7 @@ function TranslatableClassicVoteCandidatesList({ type, candidates, identifierPre
const candidate_constructor = type == "checkbox" ? CandidateWithCheckbox : CandidateWithRadio;
let finalCandidates = candidates;
if (blankVoteIsAllowed === true){
const blankVoteLabel = t("Blank vote");
const blankVoteLabel = t("blank_vote");
finalCandidates = [...candidates, blankVoteLabel]; // We assume this the right way to do it
}
const renderedCandidates = finalCandidates.map((candidate, candidateIndex) => {
......
......@@ -10,7 +10,7 @@ function TranslatableClassicVoteRecap({ question, question_index, uncryptedBallo
return e(
"li",
null,
t("Blank vote")
t("blank_vote")
);
}
else {
......
......@@ -48,7 +48,7 @@ function TranslatableInputCredentialSection({ onSubmit=null, t }){
e(
"p",
null,
t("Please enter your credential")
t("ask_for_credential")
),
e(
NiceTextInput,
......@@ -64,7 +64,7 @@ function TranslatableInputCredentialSection({ onSubmit=null, t }){
style: {
padding: "8px 28px"
},
label: t("Next"),
label: t("next_button_label"),
onClick: onClick
}
)
......
......@@ -14,7 +14,7 @@ function TranslatableMajorityJudgmentVoteCandidatesList({ identifierPrefix, avai
const candidateIndex = candidates.length;
const userHasSelectedBlankVote = blankVoteIsAllowed && (currentUserVoteForQuestion.length > candidates.length) && (currentUserVoteForQuestion[candidateIndex] === 1) ? true : false;
if (blankVoteIsAllowed){
const blankVoteLabel = t("Blank vote");
const blankVoteLabel = t("blank_vote");
const identifier = `${identifierPrefix}_blank-vote`;
const currentAlerts = currentCandidatesHavingAlertsForQuestion && currentCandidatesHavingAlertsForQuestion.includes(candidateIndex);
const dispatchBlankVoteInQuestion = (blankVoteIsChecked) => {
......
......@@ -86,7 +86,7 @@ function TranslatableMajorityJudgmentVoteRecap({ question, question_index, uncry
renderedGradedCandidates = [e(
"div",
null,
t("Blank vote")
t("blank_vote")
)];
}
else {
......
......@@ -55,7 +55,7 @@ function TranslatableMajorityJudgmentVoteSmallCandidate({ candidateInfo, availab
{
value: ""
},
t("Please select an option")
t("majority_judgment_grade_select")
),
...renderedAvailableGrades
)
......
......@@ -3,8 +3,8 @@ import { WhiteNiceButton } from "./NiceButton.mjs";
const e = React.createElement;
function TranslatableNoUuidSection({ onClickLoadFromUuid=null, onClickLoadFromParameters=null, t }){
const loadViaUuidMessage = t("Load an election on this server by giving its UUID");
const loadViaParametersMessage = t("Load any election by giving its parameters");
const loadViaUuidMessage = t("ask_election_uuid_to_load");
const loadViaParametersMessage = t("ask_election_parameters_to_load");
return e(
"div",
{
......@@ -28,7 +28,7 @@ function TranslatableNoUuidSection({ onClickLoadFromUuid=null, onClickLoadFromPa
e(
WhiteNiceButton,
{
label: t("Load from UUID"),
label: t("load_election_from_uuid_label"),
onClick: () => {
const uuid = document.querySelector("#uuid").value;
onClickLoadFromUuid(uuid);
......@@ -50,7 +50,7 @@ function TranslatableNoUuidSection({ onClickLoadFromUuid=null, onClickLoadFromPa
e(
WhiteNiceButton,
{
label: t("Load from parameters"),
label: t("load_election_from_parameters_label"),
onClick: () => {
const election_params = document.querySelector("#election_params").value;
onClickLoadFromParameters(election_params);
......
......@@ -11,14 +11,14 @@ function TranslatablePageFooter({electionUuid, electionFingerprint, t}) {
{
className: "page-footer__election-uuid-container"
},
t("electionUuid",{uuid: electionUuid})
t("election_uuid_is_x",{uuid: electionUuid})
),
e(
"div",
{
className: "page-footer__election-footprint-container"
},
t("electionFingerprint",{fingerprint: electionFingerprint})
t("election_fingerprint_is_x",{fingerprint: electionFingerprint})
)
);
}
......
......@@ -17,8 +17,8 @@ function TranslatablePageHeader({title, subTitle, t}) {
{
className: "page-header__logo__image",
src: "../../logo.png",
alt: t("Election server"),
title: t("Election server")
alt: t("election_server"),
title: t("election_server")
}
)
),
......
......@@ -325,7 +325,7 @@ function TranslatablePreferentialVotingCandidatesList({ identifierPrefix, candid
const candidateIndex = candidates.length;
const userHasSelectedBlankVote = blankVoteIsAllowed && (currentUserVoteForQuestion.length > candidates.length) && (currentUserVoteForQuestion[candidateIndex] === 1) ? true : false;
if (blankVoteIsAllowed){
const blankVoteLabel = t("Blank vote");
const blankVoteLabel = t("blank_vote");
const identifier = `${identifierPrefix}_blank-vote`;
const currentAlerts = currentCandidatesHavingAlertsForQuestion && currentCandidatesHavingAlertsForQuestion.includes(candidateIndex);
const dispatchBlankVoteInQuestion = (blankVoteIsChecked) => {
......
......@@ -55,7 +55,7 @@ function TranslatablePreferentialVotingVoteRecap({ question, question_index, unc
paddingLeft: "40px"
}
},
t("Blank vote")
t("blank_vote")
)];
}
else {
......
......@@ -7,7 +7,7 @@ function TranslatableQuestionWithVotableAnswers({ questionType, minimumAnswers,
let description;
let rendered_answers;
if (questionType === QuestionTypeEnum.MAJORITY_JUDGMENT){
description = t("majorityJudgmentQuestionDescription");
description = t("majority_judgment_question_description");
rendered_answers = e(
TranslatableMajorityJudgmentVoteCandidatesList,
{
......@@ -23,7 +23,7 @@ function TranslatableQuestionWithVotableAnswers({ questionType, minimumAnswers,
);
}
else if (questionType === QuestionTypeEnum.PREFERENTIAL_VOTING){
description = t("preferentialVotingQuestionDescription");
description = t("preferential_voting_question_description");
rendered_answers = e(
TranslatablePreferentialVotingCandidatesList,
{
......@@ -43,10 +43,10 @@ function TranslatableQuestionWithVotableAnswers({ questionType, minimumAnswers,
classic_question_subtype = "radio";
}
if ( minimumAnswers === maximumAnswers ){
description = t("selectXAnswers", {count: minimumAnswers});
description = t("ask_to_select_x_answers", {count: minimumAnswers});
}
else {
description = t("selectBetweenXAndYAnswers", {min: minimumAnswers, count: maximumAnswers});
description = t("ask_to_select_between_x_and_y_answers", {min: minimumAnswers, count: maximumAnswers});
}
rendered_answers = e(
TranslatableClassicVoteCandidatesList,
......
......@@ -20,7 +20,7 @@ function TranslatableReviewEncryptSection({
e(
"div",
null,
t("pleaseWaitDuringBallotEncryption")
t("ask_to_wait_during_ballot_encryption")
),
e(
LoadingSpinner,
......@@ -42,7 +42,7 @@ function TranslatableReviewEncryptSection({
function copyToClipboard() {
setBrowserSelectionToSmartBallotTracker();
document.execCommand("copy");
alert(t("yourSmartBallotTrackerHasBeenCopied"));
alert(t("your_smart_ballot_tracker_has_been_copied"));
}
const contentWhenBallotHasBeenEncrypted = e(
"div",
......@@ -50,7 +50,7 @@ function TranslatableReviewEncryptSection({
e(
"p",
null,
t("ballotHasBeenEncrypted")
t("your_ballot_has_been_encrypted")
),
e(
"div",
......@@ -58,7 +58,7 @@ function TranslatableReviewEncryptSection({
e(
"span",
null,
t("yourSmartBallotTracker")
t("your_smart_ballot_tracker_is")
),
e(
"div",
......@@ -81,13 +81,13 @@ function TranslatableReviewEncryptSection({
e(
"span",
null,
t("pleaseSaveYourSmartBallotTracker")
t("ask_to_save_your_smart_ballot_tracker")
),
e(
WhiteNiceButton,
{
tagName: "a",
label: t("Copy"),
label: t("copy_to_clipboard_label"),
onClick: copyToClipboard,
style: {
marginLeft: "5px"
......@@ -107,7 +107,7 @@ function TranslatableReviewEncryptSection({
NiceButton,
{
tagName: "a",
label: t("Previous"),
label: t("previous_button_label"),
style: {
...navigationButtonStyle,
marginRight: "20px"
......@@ -127,7 +127,7 @@ function TranslatableReviewEncryptSection({
e( // this Next button submits the form
BlueNiceButton,
{
label: t("Next"),
label: t("next_button_label"),
style: {
...navigationButtonStyle,
marginLeft: "20px"
......@@ -153,7 +153,7 @@ function TranslatableReviewEncryptSection({
display: "none"
}
},
t("encryptedBallot"),
t("encrypted_ballot_is"),
e(
"textarea",
{
......@@ -188,7 +188,7 @@ function TranslatableReviewEncryptSection({
e(
"h2",
null,
t("reviewBallotForQuestions", {count: uncryptedBallot.length})
t("review_ballot_for_questions", {count: uncryptedBallot.length})
),
e(
WholeVoteRecap,
......
......@@ -65,9 +65,9 @@ function GenericNavigation({ labelInfo=null, labelPreviousButton=null, labelNext
function TranslatableVoteNavigation({ question_index=0, questions_length=1, onClickPreviousButton=null, onClickNextButton=null, t }){
return GenericNavigation(
{
labelInfo: t("questionXofY", {current_question: question_index+1, number_of_questions: questions_length}),
labelPreviousButton: t("Previous"),
labelNextButton: t("Next"),
labelInfo: t("question_x_of_y", {current_question: question_index+1, number_of_questions: questions_length}),
labelPreviousButton: t("previous_button_label"),
labelNextButton: t("next_button_label"),
onClickPreviousButton: question_index == 0 ? null : onClickPreviousButton,
onClickNextButton: onClickNextButton,
disabledPreviousButton: question_index == 0 ? true : false,
......
......@@ -3,5 +3,5 @@ i18next-parser does not seem to detect translation keys which are used only as v
So we declare these translation keys here to make sure they don't get deleted from JSON translation files when we regenerate them from Javascript source files.
*/
const s1 = t("selectBetweenX");
const s2 = t("questionX");
const s1 = t("ask_to_select_between_x");
const s2 = t("question_x");
......@@ -14,17 +14,17 @@
"breadcrumb_confirm": "Confirm",
"breadcrumb_step_x": "Step {{count}}",
"breadcrumb_step_x_plural": "Step {{count}}",
"Blank vote": "Blank vote",
"Please enter your credential": "Please enter your credential:",
"Next": "Next",
"Please select an option": "Please select an option",
"Load an election on this server by giving its UUID": "Load an election on this server by giving its UUID:",
"Load any election by giving its parameters": "Load any election by giving its parameters:",
"Load from UUID": "Load from UUID",
"Load from parameters": "Load from parameters",
"electionUuid": "Election UUID: {{uuid}}",
"electionFingerprint": "Election fingerprint: {{fingerprint}}",
"Election server": "Election server",
"blank_vote": "Blank vote",
"ask_for_credential": "Please enter your credential:",
"next_button_label": "Next",
"majority_judgment_grade_select": "Please select an option",
"ask_election_uuid_to_load": "Load an election on this server by giving its UUID:",
"ask_election_parameters_to_load": "Load any election by giving its parameters:",
"load_election_from_uuid_label": "Load from UUID",
"load_election_from_parameters_label": "Load from parameters",
"election_uuid_is_x": "Election UUID: {{uuid}}",
"election_fingerprint_is_x": "Election fingerprint: {{fingerprint}}",
"election_server": "Election server",
"preferential_voting_preference_level": "Preference {{level}}",
"preferential_votign_add_preference_level": "+ Add a preference level here",
"preferential_voting_warning_delete_only_empty_level": "You can delete a level of preference only if it is empty. Please first move the candidates it contains to other preference levels.",
......@@ -32,24 +32,24 @@
"preferential_voting_drag_candidate": "Move this candidate",
"preferential_voting_move_candidate_to": "Move to",
"preferential_voting_delete_preference_level": "Delete this preference level",
"majorityJudgmentQuestionDescription": "Please grade each candidate before moving on to next step.",
"preferentialVotingQuestionDescription": "Please rank candidates by preference.",
"selectXAnswers": "Please select {{count}} answer.",
"selectXAnswers_plural": "Please select {{count}} answers.",
"selectBetweenXAndYAnswers": "$t(selectBetweenX, {\"count\": {{min}} }) and {{count}} answer.",
"selectBetweenXAndYAnswers_plural": "$t(selectBetweenX, {\"count\": {{min}} }) and {{count}} answers.",
"pleaseWaitDuringBallotEncryption": "Please wait while your ballot is being encrypted...",
"yourSmartBallotTrackerHasBeenCopied": "Your smart ballot tracker has been copied to the clipboard of your device. You can now open a text document and paste it (depending on your device, you can paste by pressing CTRL-V, or CMD-V, or long click and select Paste).",
"ballotHasBeenEncrypted": "Your ballot has been encrypted, but not cast yet!",
"yourSmartBallotTracker": "Your smart ballot tracker is:",
"pleaseSaveYourSmartBallotTracker": "Please save it to check later that your vote has been taken into account.",
"Copy": "Copy",
"Previous": "Previous",
"encryptedBallot": "Encrypted ballot:",
"reviewBallotForQuestions": "Your ballot is not yet in the ballot box, and has the following content:",
"reviewBallotForQuestions_plural": "Your ballot is not yet in the ballot box, and contains the following answers to all {{count}} questions:",
"questionXofY": "$t(questionX, {\"count\": {{current_question}} }) of {{number_of_questions}}",
"selectBetweenX": "Please select between {{count}}",
"questionX": "Question {{count}}",
"selectBetweenX_plural": "Please select between {{count}}"
"majority_judgment_question_description": "Please grade each candidate before moving on to next step.",
"preferential_voting_question_description": "Please rank candidates by preference.",
"ask_to_select_x_answers": "Please select {{count}} answer.",
"ask_to_select_x_answers_plural": "Please select {{count}} answers.",
"ask_to_select_between_x_and_y_answers": "$t(ask_to_select_between_x, {\"count\": {{min}} }) and {{count}} answer.",
"ask_to_select_between_x_and_y_answers_plural": "$t(ask_to_select_between_x, {\"count\": {{min}} }) and {{count}} answers.",
"ask_to_wait_during_ballot_encryption": "Please wait while your ballot is being encrypted...",
"your_smart_ballot_tracker_has_been_copied": "Your smart ballot tracker has been copied to the clipboard of your device. You can now open a text document and paste it (depending on your device, you can paste by pressing CTRL-V, or CMD-V, or long click and select Paste).",
"your_ballot_has_been_encrypted": "Your ballot has been encrypted, but not cast yet!",
"your_smart_ballot_tracker_is": "Your smart ballot tracker is:",
"ask_to_save_your_smart_ballot_tracker": "Please save it to check later that your vote has been taken into account.",
"copy_to_clipboard_label": "Copy",
"previous_button_label": "Previous",
"encrypted_ballot_is": "Encrypted ballot:",
"review_ballot_for_questions": "Your ballot is not yet in the ballot box, and has the following content:",
"review_ballot_for_questions_plural": "Your ballot is not yet in the ballot box, and contains the following answers to all {{count}} questions:",
"question_x_of_y": "$t(question_x, {\"count\": {{current_question}} }) of {{number_of_questions}}",
"ask_to_select_between_x": "Please select between {{count}}",
"question_x": "Question {{count}}",
"ask_to_select_between_x_plural": "Please select between {{count}}"
}
......@@ -14,17 +14,17 @@
"breadcrumb_confirm": "Confirmation",
"breadcrumb_step_x": "Étape {{count}}",
"breadcrumb_step_x_plural": "Étape {{count}}",
"Blank vote": "Vote blanc",
"Please enter your credential": "Veuillez saisir votre code de vote :",
"Next": "Suivant",
"Please select an option": "Veuillez sélectionner une mention",
"Load an election on this server by giving its UUID": "Charger une élection stockée sur ce serveur en donnant son UUID",
"Load any election by giving its parameters": "Charger n'importe quelle élection en donnant ses paramètres",
"Load from UUID": "Charger à partir de l'UUID",
"Load from parameters": "Charger à partir des paramètres",
"electionUuid": "UUID de l'élection : {{uuid}}",
"electionFingerprint": "Empreinte de l'élection : {{fingerprint}}",
"Election server": "Serveur d'élections",
"blank_vote": "Vote blanc",
"ask_for_credential": "Veuillez saisir votre code de vote :",
"next_button_label": "Suivant",
"majority_judgment_grade_select": "Veuillez sélectionner une mention",
"ask_election_uuid_to_load": "Charger une élection stockée sur ce serveur en donnant son UUID",
"ask_election_parameters_to_load": "Charger n'importe quelle élection en donnant ses paramètres",
"load_election_from_uuid_label": "Charger à partir de l'UUID",
"load_election_from_parameters_label": "Charger à partir des paramètres",
"election_uuid_is_x": "UUID de l'élection : {{uuid}}",
"election_fingerprint_is_x": "Empreinte de l'élection : {{fingerprint}}",
"election_server": "Serveur d'élections",
"preferential_voting_preference_level": "Préférence {{level}}",
"preferential_votign_add_preference_level": "+ Ajouter ici un niveau de préférence",
"preferential_voting_warning_delete_only_empty_level": "Vous ne pouvez supprimer un niveau de préférence seulement s'il est vide. Veuillez d'abord déplacer les candidats qu'il contient vers d'autres niveaux de préférence.",
......@@ -32,24 +32,24 @@
"preferential_voting_drag_candidate": "Déplacer ce candidat",
"preferential_voting_move_candidate_to": "Déplacer vers",
"preferential_voting_delete_preference_level": "Supprimer ce niveau de préférence",
"majorityJudgmentQuestionDescription": "Veuillez qualifier chaque candidat avant de passer à l'étape suivante.",
"preferentialVotingQuestionDescription": "Veuillez classer les candidats par ordre de préférence.",
"selectXAnswers": "Veuillez sélectionner {{count}} réponse.",
"selectXAnswers_plural": "Veuillez sélectionner {{count}} réponses.",
"selectBetweenXAndYAnswers": "$t(selectBetweenX, {\"count\": {{min}} }) et {{count}} réponse.",
"selectBetweenXAndYAnswers_plural": "$t(selectBetweenX, {\"count\": {{min}} }) et {{count}} réponses.",
"pleaseWaitDuringBallotEncryption": "Veuillez patienter, le chiffrement de votre bulletin de vote est en cours...",
"yourSmartBallotTrackerHasBeenCopied": "Votre numéro de suivi a été copié vers le presse-papiers de votre appareil. Vous pouvez maintenant ouvrir un document texte pour l'y coller (selon votre appareil, vous pouvez coller en appyant sur CTRL-V, ou CMD-V, ou un clic long puis sélectionner Coller).",
"ballotHasBeenEncrypted": "Votre bulletin a été chiffré avec succès, mais n'a pas encore été déposé dans l'urne !",
"yourSmartBallotTracker": "Votre numéro de suivi est :",
"pleaseSaveYourSmartBallotTracker": "Nous vous invitons à le sauvegarder, ce qui vous permettra de vérifier que votre vote aura bien été pris en compte.",
"Copy": "Copier",
"Previous": "Précédent",
"encryptedBallot": "Bulletin chiffré :",
"reviewBallotForQuestions": "Votre bulletin de vote n'est pas encore placé dans l'urne, et son contenu est :",
"reviewBallotForQuestions_plural": "Votre bulletin de vote n'est pas encore placé dans l'urne, et son contenu pour les {{count}} questions est :",
"questionXofY": "$t(questionX, {\"count\": {{current_question}} }) sur {{number_of_questions}}",
"selectBetweenX": "Veuillez sélectionner entre {{count}}",
"questionX": "Question {{count}}",
"selectBetweenX_plural": "Veuillez sélectionner entre {{count}}"
"majority_judgment_question_description": "Veuillez qualifier chaque candidat avant de passer à l'étape suivante.",
"preferential_voting_question_description": "Veuillez classer les candidats par ordre de préférence.",
"ask_to_select_x_answers": "Veuillez sélectionner {{count}} réponse.",
"ask_to_select_x_answers_plural": "Veuillez sélectionner {{count}} réponses.",
"ask_to_select_between_x_and_y_answers": "$t(ask_to_select_between_x, {\"count\": {{min}} }) et {{count}} réponse.",
"ask_to_select_between_x_and_y_answers_plural": "$t(ask_to_select_between_x, {\"count\": {{min}} }) et {{count}} réponses.",
"ask_to_wait_during_ballot_encryption": "Veuillez patienter, le chiffrement de votre bulletin de vote est en cours...",
"your_smart_ballot_tracker_has_been_copied": "Votre numéro de suivi a été copié vers le presse-papiers de votre appareil. Vous pouvez maintenant ouvrir un document texte pour l'y coller (selon votre appareil, vous pouvez coller en appyant sur CTRL-V, ou CMD-V, ou un clic long puis sélectionner Coller).",
"your_ballot_has_been_encrypted": "Votre bulletin a été chiffré avec succès, mais n'a pas encore été déposé dans l'urne !",
"your_smart_ballot_tracker_is": "Votre numéro de suivi est :",
"ask_to_save_your_smart_ballot_tracker": "Nous vous invitons à le sauvegarder, ce qui vous permettra de vérifier que votre vote aura bien été pris en compte.",
"copy_to_clipboard_label": "Copier",
"previous_button_label": "Précédent",
"encrypted_ballot_is": "Bulletin chiffré :",
"review_ballot_for_questions": "Votre bulletin de vote n'est pas encore placé dans l'urne, et son contenu est :",
"review_ballot_for_questions_plural": "Votre bulletin de vote n'est pas encore placé dans l'urne, et son contenu pour les {{count}} questions est :",
"question_x_of_y": "$t(question_x, {\"count\": {{current_question}} }) sur {{number_of_questions}}",
"ask_to_select_between_x": "Veuillez sélectionner entre {{count}}",
"question_x": "Question {{count}}",
"ask_to_select_between_x_plural": "Veuillez sélectionner entre {{count}}"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment