feat(Paypal): change local system (wip) #31

pull/37/head
Clement G 4 years ago
parent e3db6e087b
commit 75b650625f

@ -30,7 +30,7 @@ module.exports = {
// Check out https://github.com/acornjs/acorn/tree/master/acorn#interface for additional options
}
},
lngs: ["en", "fr", "es"],
lngs: ["en_GB", "fr_FR", "es_ES"],
ns: ["resource", "common"],
defaultLng: "en",
defaultNs: "resource",

@ -1,70 +1,70 @@
{
"Homepage": "Página de inicio",
"Source code": "Código fuente",
"Who are we": "Quiénes somos",
"BetterVote": "VotarMejor",
"Voting platform": "Plataforma de votación",
"Majority Judgment": "Juicio Mayoritario",
"Start an election": "Iniciar una elección",
"Candidate/proposal name...": "Nombre del(la) candidato(a)/propuesta...",
"Delete?": "Borrar?",
"Are you sure to delete": "Estás seguro de quierer 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.)",
"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",
"For example:": "Por ejemplo:",
"For the role of my representative, I judge this candidate...": "Para ser mi representante, yo elijo a este(a) candidato(a)....",
"Candidates/Proposals": "Candidatos(as)/Propuestas",
"Add a proposal": "Añadir una propuesta",
"Advanced options": "Opciones avanzadas",
"Starting date:": "Fecha de inicio:",
"Ending date: ": "Fecha de finalización: ",
"Grades:": "Escala",
"You can select here the number of grades for your election": "Puede seleccionar aquí el número de niveles de la escala para su elección",
"5 = Excellent, Very good, Good, Fair, Passable": "5 == Excelente, Muy bien, Bien, Regular, Pasable",
"Participants:": "Participantes",
"Add here participants' emails": "Añadir aquí los correos electrónicos de los participantes",
"List voters' emails in case the election is not opened": "Enumere los correos electrónicos de los votantes en caso de que la elección no se abra",
"Validate": "Validar",
"Confirm your vote": "Confirme su voto",
"The form contains no address.": "El formulario no contiene ningún correo electrónico",
"The election will be opened to anyone with the link": "La elección se abrirá a cualquiera que tenga el enlace",
"Start the election": "Iniciar la elección",
"Cancel": "Cancelar",
"Confirm": "Confirmar",
"Successful election creation!": "La elección ha sido creada con éxito!",
"You can now share the election link to participants:": "Ahora puede compartir el enlace de la elección con los participantes",
"Copy": "Copiar",
"Here is the link for the results in real time:": "En este enlace puedes revisar los resultados en tiempo real",
"Keep these links carefully": "Guarda cuidadosamente estos enlaces",
"Participate now!": "¡Participa ahora!",
"t": "<0>Advertencia</0>: No tendrás otras opciones para recuperar los enlaces, y no podremos compartirlos contigo. Por ejemplo, puedes agregarlos a favoritos de tu buscador.",
"Simple and free: organize an election with Majority Judgment.": "Simple y gratuito: organizar una elección con Juicio Mayoritario",
"Start": "Comenzar",
"No advertising or ad cookies": "No contiene publicidad ni cookies publicitarias",
"Oops! This election does not exist or it is not available anymore.": "¡Uy! Esta elección no existe o ya no está disponible",
"You can start another election.": "Puedes empezar otra elección",
"Go back to homepage": "Vuelve a la página de inicio",
"You have to judge every candidate/proposal!": "¡Tienes que evaluar a todos los(as) candidatos(as)/propuestas",
"Your participation was recorded with success!": "¡Su participación fue registrada con éxito!",
"Thanks for your participation.": "Muchas gracias por participar",
"Ending date:": "Fecha de finalización:",
"Excellent": "Excelente",
"Very good": "Muy bien",
"Good": "Bien",
"Fair": "Regular",
"Passable": "Pasable",
"Insufficient": "Insuficiente",
"To reject": "Rechazar",
"Dates": "Fechas",
"The election will take place from": "La elección tendrá lugar de las",
"at": "a las",
"to": "hasta",
"Grades": "Escala",
"Voters' list": "Lista de votantes",
"Graph": "Gráfico",
"Preference profile": "Perfil de preferencia",
"Results of the election:": "Resultados de la elección"
}
{
"Homepage": "Página de inicio",
"Source code": "Código fuente",
"Who are we": "Quiénes somos",
"BetterVote": "VotarMejor",
"Voting platform": "Plataforma de votación",
"Majority Judgment": "Juicio Mayoritario",
"Start an election": "Iniciar una elección",
"Candidate/proposal name...": "Nombre del(la) candidato(a)/propuesta...",
"Delete?": "Borrar?",
"Are you sure to delete": "Estás seguro de quierer 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.)",
"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",
"For example:": "Por ejemplo:",
"For the role of my representative, I judge this candidate...": "Para ser mi representante, yo elijo a este(a) candidato(a)....",
"Candidates/Proposals": "Candidatos(as)/Propuestas",
"Add a proposal": "Añadir una propuesta",
"Advanced options": "Opciones avanzadas",
"Starting date:": "Fecha de inicio:",
"Ending date: ": "Fecha de finalización: ",
"Grades:": "Escala",
"You can select here the number of grades for your election": "Puede seleccionar aquí el número de niveles de la escala para su elección",
"5 = Excellent, Very good, Good, Fair, Passable": "5 == Excelente, Muy bien, Bien, Regular, Pasable",
"Participants:": "Participantes",
"Add here participants' emails": "Añadir aquí los correos electrónicos de los participantes",
"List voters' emails in case the election is not opened": "Enumere los correos electrónicos de los votantes en caso de que la elección no se abra",
"Validate": "Validar",
"Confirm your vote": "Confirme su voto",
"The form contains no address.": "El formulario no contiene ningún correo electrónico",
"The election will be opened to anyone with the link": "La elección se abrirá a cualquiera que tenga el enlace",
"Start the election": "Iniciar la elección",
"Cancel": "Cancelar",
"Confirm": "Confirmar",
"Successful election creation!": "La elección ha sido creada con éxito!",
"You can now share the election link to participants:": "Ahora puede compartir el enlace de la elección con los participantes",
"Copy": "Copiar",
"Here is the link for the results in real time:": "En este enlace puedes revisar los resultados en tiempo real",
"Keep these links carefully": "Guarda cuidadosamente estos enlaces",
"Participate now!": "¡Participa ahora!",
"t": "<0>Advertencia</0>: No tendrás otras opciones para recuperar los enlaces, y no podremos compartirlos contigo. Por ejemplo, puedes agregarlos a favoritos de tu buscador.",
"Simple and free: organize an election with Majority Judgment.": "Simple y gratuito: organizar una elección con Juicio Mayoritario",
"Start": "Comenzar",
"No advertising or ad cookies": "No contiene publicidad ni cookies publicitarias",
"Oops! This election does not exist or it is not available anymore.": "¡Uy! Esta elección no existe o ya no está disponible",
"You can start another election.": "Puedes empezar otra elección",
"Go back to homepage": "Vuelve a la página de inicio",
"You have to judge every candidate/proposal!": "¡Tienes que evaluar a todos los(as) candidatos(as)/propuestas",
"Your participation was recorded with success!": "¡Su participación fue registrada con éxito!",
"Thanks for your participation.": "Muchas gracias por participar",
"Ending date:": "Fecha de finalización:",
"Excellent": "Excelente",
"Very good": "Muy bien",
"Good": "Bien",
"Fair": "Regular",
"Passable": "Pasable",
"Insufficient": "Insuficiente",
"To reject": "Rechazar",
"Dates": "Fechas",
"The election will take place from": "La elección tendrá lugar de las",
"at": "a las",
"to": "hasta",
"Grades": "Escala",
"Voters' list": "Lista de votantes",
"Graph": "Gráfico",
"Preference profile": "Perfil de preferencia",
"Results of the election:": "Resultados de la elección"
}

@ -9,7 +9,7 @@ const Helloasso = (props) => {
return (
<a href={linkHelloAssoBanner} target="_blank" rel="noopener noreferrer">
<img src={"/banner/"+locale+"/helloasso.png"} style={{width:props.width}} />
<img src={"/banner/"+locale+"/helloasso.png"} alt="support us on helloasso" style={{width:props.width}} />
</a>);
};

@ -0,0 +1,21 @@
import React from 'react';
import i18n from '../../i18n'
const Paypal = (props) => {
const localeStringShort=i18n.language.substring(0,2);
const localeStringComplete=localeStringShort.toLowerCase()+"_"+localeStringShort.toUpperCase();
const imageLink="https://www.paypalobjects.com/"+localeStringComplete+"/"+localeStringShort.toUpperCase()+"/i/btn/btn_donateCC_LG.gif";
const pixelLink="https://www.paypal.com/"+localeStringComplete+"/i/scr/pixel.gif";
return (
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="KB2Z7L9KARS7C" />
<input type="image" src={imageLink} style={{border:"none"}} name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src={pixelLink} width="1" height="1" />
</form>);
};
export default Paypal;

@ -5,6 +5,7 @@ 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) {
@ -28,19 +29,20 @@ class Footer extends Component {
<span className="m-2">-</span>
<a href="https://mieuxvoter.fr/" target="_blank" rel="noopener noreferrer" style={linkStyle} >{t("Who are we")}</a>
<span className="m-2">-</span>
<button style={buttonStyle} onClick={() => i18n.changeLanguage('en')}>
<button style={buttonStyle} onClick={() => i18n.changeLanguage('en_EN')}>
<FlagIcon code={"gb"} />
</button>
{" "}
<button style={buttonStyle} onClick={() => i18n.changeLanguage('fr')}>
<button style={buttonStyle} onClick={() => i18n.changeLanguage('fr_FR')}>
<FlagIcon code={"fr"} />
</button>
{" "}
<button style={buttonStyle} onClick={() => i18n.changeLanguage('es')}>
<button style={buttonStyle} onClick={() => i18n.changeLanguage('es_ES')}>
<FlagIcon code={"es"} />
</button>
<div className="mt-3">
<Helloasso width="150px" />
<Paypal />
</div>
</footer>
);

@ -3,13 +3,13 @@ import XHR from 'i18next-xhr-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';
console.log("locale="+navigator.language);
i18n
.use(XHR)
.use(LanguageDetector)
.use(initReactI18next) // bind react-i18next to the instance
.init({
fallbackLng: 'en',
fallbackLng: 'en_GB',
debug: true,
saveMissing: true, // send not translated keys to endpoint

Loading…
Cancel
Save