More i18n work

This commit is contained in:
vjrj 2017-11-28 22:49:25 +01:00
parent 2ad4972115
commit fffeb2a17a
13 changed files with 85 additions and 27 deletions

View file

@ -16,7 +16,7 @@ const Footer = (props) => {
return ( return (
<div className="Footer"> <div className="Footer">
<Grid> <Grid>
<p className="pull-left"><span className="reverse">&copy;</span><span className="d-none d-md-inline"> Copyleft</span> {copyrightYear()} <a href="https://comunes.org/"><span className="d-none d-md-inline">{t('OrgNameFull')}</span><span className="d-inline d-md-none">{t('OrgName')}</span></a></p> <p className="pull-left"><span className="reverse">&copy;</span><span className="d-none d-md-inline"> Copyleft</span> {copyrightYear()} <a href="https://comunes.org/"><span className="d-none d-md-inline">{t('OrgName')}</span><span className="d-inline d-md-none">{t('OrgName')}</span></a></p>
<ul className="pull-right"> <ul className="pull-right">
<li><Link to="/terms"> {t('Términos')}<span className="d-none d-md-inline"> {t('de Servicio')}</span></Link></li> <li><Link to="/terms"> {t('Términos')}<span className="d-none d-md-inline"> {t('de Servicio')}</span></Link></li>

View file

@ -14,7 +14,7 @@ const Navigation = props => (
<Navbar.Header> <Navbar.Header>
{window.location.pathname != '/'? {window.location.pathname != '/'?
<Navbar.Brand> <Navbar.Brand>
<Link to="/">{props.t('Inicio')}</Link> <Link to="/">{props.t('AppNameFull')}</Link>
</Navbar.Brand>: '' </Navbar.Brand>: ''
} }
{/* <Navbar.Toggle/> */} {/* <Navbar.Toggle/> */}

View file

@ -24,5 +24,5 @@ a.nav-link:hover {
} }
.navbar { .navbar {
padding: 0.3rem 1rem; padding: 0.3rem 0rem;
} }

View file

@ -10,7 +10,8 @@
.EmailMessage { .EmailMessage {
display: inline-block; display: inline-block;
background: #fff; background: #fff; /* default */
background: lighten($todos-palette5, 70%);
padding: 0 10px; padding: 0 10px;
position: absolute; position: absolute;
bottom: -27px; bottom: -27px;

View file

@ -57,7 +57,7 @@ class Login extends React.Component {
render() { render() {
return (<div className="Login"> return (<div className="Login">
<Row> <Row className="align-items-center justify-content-center">
<Col xs={12} sm={6} md={5} lg={4}> <Col xs={12} sm={6} md={5} lg={4}>
<h4 className="page-header">{this.t("Iniciar sesión")}</h4> <h4 className="page-header">{this.t("Iniciar sesión")}</h4>
<Row> <Row>

View file

@ -53,7 +53,7 @@ class RecoverPassword extends React.Component {
render() { render() {
return (<div className="RecoverPassword"> return (<div className="RecoverPassword">
<Row> <Row className="align-items-center justify-content-center">
<Col xs={12} sm={6} md={5} lg={4}> <Col xs={12} sm={6} md={5} lg={4}>
<h4 className="page-header">{this.t("Recupera tu contraseña")}</h4> <h4 className="page-header">{this.t("Recupera tu contraseña")}</h4>
<Alert bsStyle="info"> <Alert bsStyle="info">

View file

@ -5,10 +5,12 @@ import Col from '../../components/Col/Col';
import { Accounts } from 'meteor/accounts-base'; import { Accounts } from 'meteor/accounts-base';
import { Bert } from 'meteor/themeteorchef:bert'; import { Bert } from 'meteor/themeteorchef:bert';
import validate from '../../../modules/validate'; import validate from '../../../modules/validate';
import { translate } from 'react-i18next';
class ResetPassword extends React.Component { class ResetPassword extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.t = props.t;
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
} }
@ -29,12 +31,13 @@ class ResetPassword extends React.Component {
}, },
messages: { messages: {
newPassword: { newPassword: {
required: 'Enter a new password, please.', required: this.t("Introduce una nueva contraseña, por favor."),
minlength: 'Use at least six characters, please.', minlength: this.t("Usa al menos seis caracteres."),
}, },
repeatNewPassword: { repeatNewPassword: {
required: 'Repeat your new password, please.', required: this.t("Repite tu nueva contraseña, por favor."),
equalTo: 'Hmm, your passwords don\'t match. Try again?', equalTo: this.t("Mmmm, tus contraseñas no coinciden. ¿Inténtalo otra vez?"),
minlength: this.t("Usa al menos seis caracteres."),
}, },
}, },
submitHandler() { component.handleSubmit(); }, submitHandler() { component.handleSubmit(); },
@ -56,35 +59,34 @@ class ResetPassword extends React.Component {
render() { render() {
return (<div className="ResetPassword"> return (<div className="ResetPassword">
<Row> <Row className="align-items-center justify-content-center">
<Col xs={12} sm={6} md={4}> <Col xs={12} sm={6} md={4}>
<h4 className="page-header">Reset Password</h4> <h4 className="page-header">{this.t("Resetea tu contraseña")}</h4>
<Alert bsStyle="info"> <Alert bsStyle="info">
To reset your password, enter a new one below. You will be logged in { this.t("Para resetear tu contraseña, introduce una nueva debajo. Iniciarás la sesión con la nueva contraseña.") }
with your new password.
</Alert> </Alert>
<form ref={form => (this.form = form)} onSubmit={event => event.preventDefault()}> <form ref={form => (this.form = form)} onSubmit={event => event.preventDefault()}>
<FormGroup> <FormGroup>
<ControlLabel>New Password</ControlLabel> <ControlLabel>{this.t("Nueva contraseña")}</ControlLabel>
<input <input
type="password" type="password"
className="form-control" className="form-control"
ref={newPassword => (this.newPassword = newPassword)} ref={newPassword => (this.newPassword = newPassword)}
name="newPassword" name="newPassword"
placeholder="New Password" placeholder={this.t("Nueva contraseña")}
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<ControlLabel>Repeat New Password</ControlLabel> <ControlLabel>{this.t("Repite la nueva contraseña")}</ControlLabel>
<input <input
type="password" type="password"
className="form-control" className="form-control"
ref={repeatNewPassword => (this.repeatNewPassword = repeatNewPassword)} ref={repeatNewPassword => (this.repeatNewPassword = repeatNewPassword)}
name="repeatNewPassword" name="repeatNewPassword"
placeholder="Repeat New Password" placeholder={this.t("Repite la nueva contraseña")}
/> />
</FormGroup> </FormGroup>
<Button type="submit" bsStyle="success">Reset Password &amp; Login</Button> <Button type="submit" bsStyle="success">{this.t("Resetea la contraseña y entra")}</Button>
</form> </form>
</Col> </Col>
</Row> </Row>
@ -97,4 +99,4 @@ ResetPassword.propTypes = {
history: PropTypes.object.isRequired, history: PropTypes.object.isRequired,
}; };
export default ResetPassword; export default translate([], { wait: true })(ResetPassword);

View file

@ -86,7 +86,7 @@ class Signup extends React.Component {
render() { render() {
return (<div className="Signup"> return (<div className="Signup">
<Row> <Row className="align-items-center justify-content-center">
<Col xs={12} sm={6} md={5} lg={4}> <Col xs={12} sm={6} md={5} lg={4}>
<h4 className="page-header">{this.t("Registrarse")}</h4> <h4 className="page-header">{this.t("Registrarse")}</h4>
<Row> <Row>

View file

@ -4,10 +4,12 @@ import { Alert } from 'react-bootstrap';
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base'; import { Accounts } from 'meteor/accounts-base';
import { Bert } from 'meteor/themeteorchef:bert'; import { Bert } from 'meteor/themeteorchef:bert';
import { translate } from 'react-i18next';
class VerifyEmail extends React.Component { class VerifyEmail extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.t = props.t;
this.state = { error: null }; this.state = { error: null };
} }
@ -16,10 +18,11 @@ class VerifyEmail extends React.Component {
Accounts.verifyEmail(match.params.token, (error) => { Accounts.verifyEmail(match.params.token, (error) => {
if (error) { if (error) {
Bert.alert(error.reason, 'danger'); Bert.alert(error.reason, 'danger');
this.setState({ error: `${error.reason}. Please try again.` }); this.setState({ error: error.reason + ". " + this.t("Por favor, inténtalo otra vez.")});
// this.setState({ error: `${error.reason}. Please try again.` });
} else { } else {
setTimeout(() => { setTimeout(() => {
Bert.alert('All set, thanks!', 'success'); Bert.alert(this.t("¡Listo, gracias!"), 'success');
history.push('/documents'); history.push('/documents');
}, 1500); }, 1500);
} }
@ -29,7 +32,7 @@ class VerifyEmail extends React.Component {
render() { render() {
return (<div className="VerifyEmail"> return (<div className="VerifyEmail">
<Alert bsStyle={!this.state.error ? 'info' : 'danger'}> <Alert bsStyle={!this.state.error ? 'info' : 'danger'}>
{!this.state.error ? 'Verifying...' : this.state.error} {!this.state.error ? this.t('Verificando...') : this.state.error}
</Alert> </Alert>
</div>); </div>);
} }
@ -40,4 +43,4 @@ VerifyEmail.propTypes = {
history: PropTypes.object.isRequired, history: PropTypes.object.isRequired,
}; };
export default VerifyEmail; export default translate([], { wait: true })(VerifyEmail);

View file

@ -9,3 +9,7 @@
margin-top: 20px; margin-top: 20px;
} }
} }
body {
background-color: lighten($todos-palette5, 70%);
}

View file

@ -5,3 +5,7 @@ a, a:hover {
.bg-dark { .bg-dark {
background-color: $todos-palette1 !important; background-color: $todos-palette1 !important;
} }
h4.page-header {
line-height: 2em;
}

View file

@ -77,5 +77,27 @@
"checkVerificationEmail": "checkVerificationEmail":
"Check {{email}} for a verification link!", "Check {{email}} for a verification link!",
"checkResetEmail": "checkResetEmail":
"Check ${email} for a reset link!" "Check ${email} for a reset link!",
"¡Listo, gracias!":
"All set, thanks!",
"Por favor, inténtalo otra vez.":
"Please try again.",
"Verificando...":
"Verifying...",
"Introduce una nueva contraseña, por favor.":
"Enter a new password, please.",
"Repite tu nueva contraseña, por favor.":
"Repeat your new password, please.",
"Mmmm, tus contraseñas no coinciden. Inténtalo otra vez":
"Hmm, your passwords don't match. Try again",
"Para resetear tu contraseña, introduce una nueva debajo. Iniciarás la sesión con la nueva contraseña.":
"To reset your password, enter a new one below. You will be logged in with your new password.",
"Resetea tu contraseña":
"Reset Password",
"Nueva contraseña":
"New Password",
"Repite la nueva contraseña":
"Repeat New Password",
"Resetea la contraseña y entra":
"Reset Password &amp; Login"
} }

View file

@ -78,5 +78,27 @@
"checkVerificationEmail": "checkVerificationEmail":
"¡Comprueba en tu correo {{email}} el enlace de verificación!", "¡Comprueba en tu correo {{email}} el enlace de verificación!",
"checkResetEmail": "checkResetEmail":
"¡Comprueba en tu correo {{email}} el enlace de reseteo!" "¡Comprueba en tu correo {{email}} el enlace de reseteo!",
"¡Listo, gracias!":
"¡Listo, gracias!",
"Por favor, inténtalo otra vez.":
"Por favor, inténtalo otra vez.",
"Verificando...":
"Verificando...",
"Introduce una nueva contraseña, por favor.":
"Introduce una nueva contraseña, por favor.",
"Repite tu nueva contraseña, por favor.":
"Repite tu nueva contraseña, por favor.",
"Mmmm, tus contraseñas no coinciden. Inténtalo otra vez":
"Mmmm, tus contraseñas no coinciden. Inténtalo otra vez",
"Para resetear tu contraseña, introduce una nueva debajo. Iniciarás la sesión con la nueva contraseña.":
"Para resetear tu contraseña, introduce una nueva abajo. Iniciarás la sesión con la nueva contraseña.",
"Resetea tu contraseña":
"Resetea tu contraseña",
"Nueva contraseña":
"Nueva contraseña",
"Repite la nueva contraseña":
"Repite la nueva contraseña",
"Resetea la contraseña y entra":
"Resetea la contraseña y entra"
} }