diff --git a/public/locale/i18n/de/resource.json b/public/locale/i18n/de/resource.json index 72699b8..78c208f 100644 --- a/public/locale/i18n/de/resource.json +++ b/public/locale/i18n/de/resource.json @@ -11,6 +11,7 @@ "Are you sure to delete": "Sind Sie sich sicher, dass Sie dies löschen möchten?", "the row": "die Zeile", "Write here your question or introduce simple your election (250 characters max.)": "Schreiben Sie hier Ihre Frage oder erklären Sie kurz ihre Wahl (bis 250 Zeichen)", + "Enter the name of your candidate or proposal here (250 characters max.)": "Geben Sie hier den Namen Ihres Kandidaten oder Antrags ein (max. 250 Zeichen)", "Please add at least 2 candidates.": "Bitte geben Sie mindestens zwei Kandidaten vor. ", "Question of the election": "Zur Wahl stehende Frage", "Write here the question of your election": "Schreiben Sie hier die zur Wahl stehenden Frage", diff --git a/public/locale/i18n/en/resource.json b/public/locale/i18n/en/resource.json index 0ba295a..8be6f24 100644 --- a/public/locale/i18n/en/resource.json +++ b/public/locale/i18n/en/resource.json @@ -11,6 +11,7 @@ "Are you sure to delete": "Are you sure to delete", "the row": "the row", "Write here your question or introduce simple your election (250 characters max.)": "Write here your question or introduce simple your election (250 characters max.)", + "Enter the name of your candidate or proposal here (250 characters max.)":"Enter the name of your candidate or proposal here (250 characters max.)", "Please add at least 2 candidates.": "Please add at least 2 candidates.", "Question of the election": "Question of the election", "Write here the question of your election": "Write here the question of your election", diff --git a/public/locale/i18n/es/resource.json b/public/locale/i18n/es/resource.json index a40cdf6..1176d17 100644 --- a/public/locale/i18n/es/resource.json +++ b/public/locale/i18n/es/resource.json @@ -11,6 +11,7 @@ "Are you sure to delete": "Estás seguro de querer borrar", "the row": "la fila", "Write here your question or introduce simple your election (250 characters max.)": "Escriba aquí su pregunta o introduzca simplemente su elección (250 caracteres máx.)", + "Enter the name of your candidate or proposal here (250 characters max.)": "Escriba aquí el nombre de su candidato o propuesta (250 caracteres como máximo)", "Please add at least 2 candidates.": "Por favor, añada al menos dos canidatos(as).", "Question of the election": "Pregunta de su elección", "Write here the question of your election": "Escriba aquí la pregunta de su elección", diff --git a/public/locale/i18n/fr/resource.json b/public/locale/i18n/fr/resource.json index 8802549..f2c0857 100644 --- a/public/locale/i18n/fr/resource.json +++ b/public/locale/i18n/fr/resource.json @@ -11,6 +11,7 @@ "Are you sure to delete": "Êtes-vous sûr(e) de supprimer", "the row": "la ligne", "Write here your question or introduce simple your election (250 characters max.)": "Décrire ici votre question ou introduire simplement votre élection (250 caractères max.)", + "Enter the name of your candidate or proposal here (250 characters max.)": "Saisissez ici le nom de votre candidat ou de votre proposition (250 caractères max.)", "Please add at least 2 candidates.": "Merci d'ajouter au moins 2 candidats.", "Question of the election": "Question de votre élection", "Write here the question of your election": "Ecrire ici la question de votre élection", diff --git a/public/locale/i18n/ru/resource.json b/public/locale/i18n/ru/resource.json index 15de841..7a0ccca 100644 --- a/public/locale/i18n/ru/resource.json +++ b/public/locale/i18n/ru/resource.json @@ -11,6 +11,7 @@ "Are you sure to delete": "Вы уверены в удалении", "the row": "ряд", "Write here your question or introduce simple your election (250 characters max.)": "Напишите свой вопрос или опишите голосование (250 символов максимум.)", + "Enter the name of your candidate or proposal here (250 characters max.)": "Введите имя вашего кандидата или предложение здесь (не более 250 символов).", "Please add at least 2 candidates.": "Пожалуйста добавьте как минимум 2 кандидатов", "Question of the election": "Суть голосования", "Write here the question of your election": "Напишите вопрос вашего голосования", diff --git a/src/components/views/CreateElection.jsx b/src/components/views/CreateElection.jsx index 63890a1..f7ed147 100644 --- a/src/components/views/CreateElection.jsx +++ b/src/components/views/CreateElection.jsx @@ -138,7 +138,7 @@ const SortableCandidate = sortableElement( {t( - "Write here your question or introduce simple your election (250 characters max.)" + "Enter the name of your candidate or proposal here (250 characters max.)" )} @@ -229,7 +229,7 @@ class CreateElection extends Component { editCandidateLabel = (event, index) => { let candidates = this.state.candidates; candidates[index].label = event.currentTarget.value; - candidates.map((candidate) => { + candidates.map(candidate => { return candidate.label; }); this.setState({ @@ -264,14 +264,13 @@ class CreateElection extends Component { checkFields() { const { candidates, title } = this.state; - if (!candidates) { return { ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR }; } let numCandidates = 0; candidates.forEach(c => { - if (c !== "") numCandidates += 1; + if (c.label !== "") numCandidates += 1; }); if (numCandidates < 2) { return { ok: false, msg: AT_LEAST_2_CANDIDATES_ERROR }; @@ -470,10 +469,10 @@ class CreateElection extends Component { - + - + - +