diff --git a/package.json b/package.json
index 3daaa66..94ac1c7 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
"@babel/core": "7.4.3",
"@fortawesome/fontawesome-free": "^5.9.0",
"@fortawesome/fontawesome-svg-core": "^1.2.19",
+ "@fortawesome/free-brands-svg-icons": "^5.13.0",
"@fortawesome/free-solid-svg-icons": "^5.9.0",
"@fortawesome/react-fontawesome": "^0.1.4",
"@svgr/webpack": "4.1.0",
@@ -62,6 +63,7 @@
"react-dev-utils": "^9.0.1",
"react-dom": "^16.8.6",
"react-flag-icon-css": "^1.0.25",
+ "react-flags-select": "^1.1.12",
"react-i18next": "^11.3.4",
"react-loader-spinner": "^3.1.14",
"react-multi-email": "^0.5.3",
diff --git a/public/locale/i18n/de/resource.json b/public/locale/i18n/de/resource.json
index 76b4777..9b24372 100644
--- a/public/locale/i18n/de/resource.json
+++ b/public/locale/i18n/de/resource.json
@@ -1,7 +1,7 @@
{
"Homepage": " Homepage ",
"Source code": "Quellcode",
- "Who are we": "Wer wir sind",
+ "Who are we?": "Wer wir sind?",
"BetterVote": " BetterVote",
"Voting platform": "Wahlplattform",
"Majority Judgment": " Mehrheitswahl ",
@@ -50,6 +50,9 @@
"You have to judge every candidate/proposal!": "Sie müssen jeden Kandidaten/Abstimmungsvorschlag bewerten!",
"Your participation was recorded with success!": " Ihre Teilnahme wurde gespeichert!",
"Thanks for your participation.": " Vielen Dank für Ihre Teilnahme.",
+ "Support us !" : "Unterstützen Sie uns!",
+ "PayPal - The safer, easier way to pay online!" : "PayPal - Die sicherere und einfachere Art, online zu bezahlen!",
+ "Number of votes:" : "Anzahl der Stimmen:"
"Unknown error. Try again please.": "__STRING_NOT_TRANSLATED__",
"Ending date:": "__STRING_NOT_TRANSLATED__",
"If you list voters' emails, only them will be able to access the election": "__STRING_NOT_TRANSLATED__",
@@ -71,5 +74,4 @@
"You need a token to vote in this election": "__STRING_NOT_TRANSLATED__",
"You seem to have already voted.": "__STRING_NOT_TRANSLATED__",
"The parameters of the election are incorrect.": "__STRING_NOT_TRANSLATED__",
- "Number of votes:": "__STRING_NOT_TRANSLATED__"
}
diff --git a/public/locale/i18n/en/resource.json b/public/locale/i18n/en/resource.json
index ec94e02..2bc1c4d 100644
--- a/public/locale/i18n/en/resource.json
+++ b/public/locale/i18n/en/resource.json
@@ -1,7 +1,7 @@
{
"Homepage": "Homepage",
"Source code": "Source code",
- "Who are we": "Who are we",
+ "Who are we?": "Who are we?",
"BetterVote": "BetterVote",
"Voting platform": "Voting platform",
"Majority Judgment": "Majority Judgment",
@@ -78,5 +78,7 @@
"You need a token to vote in this election": "You need a token to vote in this election",
"You seem to have already voted.": "You seem to have already voted.",
"The parameters of the election are incorrect.": "The parameters of the election are incorrect.",
- "Number of votes:": "Number of votes:"
+ "Support us !" : "Support us !",
+ "PayPal - The safer, easier way to pay online!" : "PayPal - The safer, easier way to pay online!",
+ "Number of votes:" : "Number of votes:"
}
diff --git a/public/locale/i18n/es/resource.json b/public/locale/i18n/es/resource.json
index 5ab4346..5b06cfd 100644
--- a/public/locale/i18n/es/resource.json
+++ b/public/locale/i18n/es/resource.json
@@ -1,7 +1,7 @@
{
"Homepage": "Página de inicio",
"Source code": "Código fuente",
- "Who are we": "Quiénes somos",
+ "Who are we?": "¿Quiénes somos?",
"BetterVote": "VotarMejor",
"Voting platform": "Plataforma de votación",
"Majority Judgment": "Juicio Mayoritario",
@@ -78,5 +78,7 @@
"You need a token to vote in this election": "__STRING_NOT_TRANSLATED__",
"You seem to have already voted.": "__STRING_NOT_TRANSLATED__",
"The parameters of the election are incorrect.": "__STRING_NOT_TRANSLATED__",
- "Number of votes:": "__STRING_NOT_TRANSLATED__"
+ "Support us !" : "¡Apóyanos!",
+ "PayPal - The safer, easier way to pay online!" : "PayPal - ¡La forma más segura y fácil de pagar en línea!",
+ "Number of votes:" : "Número de votos:"
}
diff --git a/public/locale/i18n/fr/resource.json b/public/locale/i18n/fr/resource.json
index 7e7de65..54d5578 100644
--- a/public/locale/i18n/fr/resource.json
+++ b/public/locale/i18n/fr/resource.json
@@ -1,7 +1,7 @@
{
"Homepage": "Accueil",
"Source code": "Code source",
- "Who are we": "Qui sommes-nous",
+ "Who are we?": "Qui sommes-nous ?",
"BetterVote": "MieuxVoter",
"Voting platform": "Plateforme de vote",
"Majority Judgment": "Jugement Majoritaire",
@@ -78,5 +78,7 @@
"You need a token to vote in this election": "Vous avez besoin d'un jeton pour voter dans cette élection",
"You seem to have already voted.": "Il semble que vous ayez déjà voté.",
"The parameters of the election are incorrect.": "Les paramètres de l'élection sont incorrects.",
- "Number of votes:": "Nombre de votes :"
+ "Support us !" : "Soutenez-nous !",
+ "PayPal - The safer, easier way to pay online!" : "PayPal - Le moyen le plus sûr et le plus simple de payer en ligne !",
+ "Number of votes:" : "Nombre de votes :"
}
diff --git a/src/Errors.js b/src/Errors.js
index 27f8c11..a665df0 100644
--- a/src/Errors.js
+++ b/src/Errors.js
@@ -1,49 +1,60 @@
-import React from 'react';
-import {
- Container,
- Row,
- Col,
-} from "reactstrap";
+import React from "react";
+import { Container, Row, Col } from "reactstrap";
+import { Link } from "react-router-dom";
+import logoLine from "./logos/logo-line-white.svg";
+import { withTranslation } from "react-i18next";
-export const UNKNOWN_ELECTION_ERROR = 'E1';
-export const ONGOING_ELECTION_ERROR = 'E2';
-export const NO_VOTE_ERROR = 'E3';
-export const ELECTION_NOT_STARTED_ERROR = 'E4';
-export const ELECTION_FINISHED_ERROR = 'E5';
-export const INVITATION_ONLY_ERROR = 'E6';
-export const UNKNOWN_TOKEN_ERROR = 'E7';
-export const USED_TOKEN_ERROR = 'E8';
-export const WRONG_ELECTION_ERROR = 'E9';
+export const UNKNOWN_ELECTION_ERROR = "E1";
+export const ONGOING_ELECTION_ERROR = "E2";
+export const NO_VOTE_ERROR = "E3";
+export const ELECTION_NOT_STARTED_ERROR = "E4";
+export const ELECTION_FINISHED_ERROR = "E5";
+export const INVITATION_ONLY_ERROR = "E6";
+export const UNKNOWN_TOKEN_ERROR = "E7";
+export const USED_TOKEN_ERROR = "E8";
+export const WRONG_ELECTION_ERROR = "E9";
export const redirectError = (errorMsg, history) => {};
export const errorMessage = (error, t) => {
if (error.startsWith(UNKNOWN_ELECTION_ERROR)) {
- return t('Oops... The election is unknown.');
+ return t("Oops... The election is unknown.");
} else if (error.startsWith(ONGOING_ELECTION_ERROR)) {
return t(
- "The election is still going on. You can't access now to the results.",
+ "The election is still going on. You can't access now to the results."
);
} else if (error.startsWith(NO_VOTE_ERROR)) {
- return t('No votes have been recorded yet. Come back later.');
+ return t("No votes have been recorded yet. Come back later.");
} else if (error.startsWith(ELECTION_NOT_STARTED_ERROR)) {
- return t('The election has not started yet.');
+ return t("The election has not started yet.");
} else if (error.startsWith(ELECTION_FINISHED_ERROR)) {
- return t('The election is over. You can\'t vote anymore');
+ return t("The election is over. You can't vote anymore");
} else if (error.startsWith(INVITATION_ONLY_ERROR)) {
- return t('You need a token to vote in this election');
+ return t("You need a token to vote in this election");
} else if (error.startsWith(USED_TOKEN_ERROR)) {
- return t('You seem to have already voted.');
+ return t("You seem to have already voted.");
} else if (error.startsWith(WRONG_ELECTION_ERROR)) {
- return t('The parameters of the election are incorrect.');
+ return t("The parameters of the election are incorrect.");
}
};
-export const Error = (props) => (
+export const Error = props => (
-
-
{props.value}
+
+
+
+
+
+
+
{props.value}
+
+
+
+
+
+ Back to home page
+
diff --git a/src/components/banner/Helloasso.jsx b/src/components/banner/Helloasso.jsx
index fb0002a..7dfa6ee 100644
--- a/src/components/banner/Helloasso.jsx
+++ b/src/components/banner/Helloasso.jsx
@@ -9,7 +9,7 @@ const Helloasso = (props) => {
return (
-
+
);
};
diff --git a/src/components/banner/Paypal.jsx b/src/components/banner/Paypal.jsx
new file mode 100644
index 0000000..38b9945
--- /dev/null
+++ b/src/components/banner/Paypal.jsx
@@ -0,0 +1,29 @@
+import React from 'react';
+import i18n from '../../i18n'
+import {withTranslation} from 'react-i18next';
+
+import { faPaypal } from "@fortawesome/free-brands-svg-icons";
+import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
+
+
+const Paypal = (props) => {
+ const {t} = props;
+ let localeStringShort=i18n.language.substring(0,2);
+ let localeStringComplete=localeStringShort.toLowerCase()+"_"+localeStringShort.toUpperCase();
+ if(localeStringComplete==="en_EN"){
+ localeStringComplete="en_US";
+ }
+ const pixelLink="https://www.paypal.com/"+localeStringComplete+"/i/scr/pixel.gif";
+
+ return (
+
+
);
+};
+
+
+export default withTranslation()(Paypal);
\ No newline at end of file
diff --git a/src/components/layouts/Footer.jsx b/src/components/layouts/Footer.jsx
index c762599..d28f34a 100644
--- a/src/components/layouts/Footer.jsx
+++ b/src/components/layouts/Footer.jsx
@@ -1,10 +1,7 @@
import React, { Component, Fragment } from "react";
import {withTranslation} from 'react-i18next';
import { Link } from "react-router-dom";
-
-import { FlagIcon } from '../flag'
-import i18n from '../../i18n'
-import Helloasso from "../banner/Helloasso";
+import Paypal from "../banner/Paypal";
class Footer extends Component {
constructor(props) {
@@ -17,23 +14,15 @@ class Footer extends Component {
render() {
- const buttonStyle = {backgroundColor: "black", padding: "0px", border: "0px",};
const linkStyle = {whiteSpace: "nowrap"};
const {t} = this.props;
- const countries = [
- {"l": "en", "flag": "gb"},
- {"l": "es", "flag": "es"},
- {"l": "fr", "flag": "fr"},
- {"l": "de", "flag": "de"},
- ];
-
return (
);
diff --git a/src/components/layouts/Header.jsx b/src/components/layouts/Header.jsx
index 3b4009d..5cb1e29 100644
--- a/src/components/layouts/Header.jsx
+++ b/src/components/layouts/Header.jsx
@@ -7,6 +7,7 @@ import { withTranslation } from 'react-i18next';
import logo from "../../logos/logo-color.svg";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faRocket } from "@fortawesome/free-solid-svg-icons";
+import LanguageSelector from "./LanguageSelector";
class Header extends Component {
state = {
@@ -44,10 +45,13 @@ class Header extends Component {
diff --git a/src/components/layouts/LanguageSelector.jsx b/src/components/layouts/LanguageSelector.jsx
new file mode 100644
index 0000000..8661e6a
--- /dev/null
+++ b/src/components/layouts/LanguageSelector.jsx
@@ -0,0 +1,30 @@
+import React from 'react';
+import ReactFlagsSelect from 'react-flags-select';
+import 'react-flags-select/css/react-flags-select.css';
+
+import i18n from '../../i18n'
+
+
+
+const LanguageSelector = () => {
+
+ const selectHandler = (e) => {
+ let locale=e.toLowerCase();
+ if(locale==="gb")locale="en";
+ i18n.changeLanguage(locale);
+ };
+
+ let locale=i18n.language.substring(0,2).toUpperCase();
+ if(locale==="EN")locale="GB";
+ return ();
+};
+
+
+export default LanguageSelector;
\ No newline at end of file
diff --git a/src/components/views/CreateElection.jsx b/src/components/views/CreateElection.jsx
index 59db056..d6559da 100644
--- a/src/components/views/CreateElection.jsx
+++ b/src/components/views/CreateElection.jsx
@@ -38,6 +38,7 @@ import {AppContext} from '../../AppContext';
import HelpButton from '../form/HelpButton';
import ButtonWithConfirm from '../form/ButtonWithConfirm';
import Loader from '../wait';
+import i18n from '../../i18n'
// Error messages
@@ -61,90 +62,90 @@ const timeMinusDate = date => time(date);
const dateMinusTime = date => new Date(date.getTime() - time(date));
const DragHandle = sortableHandle(({children}) => (
- {children}
+ {children}
));
const displayClockOptions = () =>
- Array(24)
- .fill(1)
- .map((x, i) => (
-
- ));
+ Array(24)
+ .fill(1)
+ .map((x, i) => (
+
+ ));
const SortableCandidate = sortableElement(({candidate, sortIndex, form, t}) => (
-