Moving the translations too

This commit is contained in:
okbel
2018-05-02 14:08:29 -03:00
parent 780bd42ceb
commit 8dcaf8ea4c
7 changed files with 132 additions and 50 deletions
@@ -28,26 +28,26 @@ class ChangeEmailContentDialog extends React.Component {
×
</span>
<h1 className={styles.title}>
{t('talk-plugin-auth.change_email.confirm_email_change')}
{t('talk-plugin-local-auth.change_email.confirm_email_change')}
</h1>
<div className={styles.content}>
<p className={styles.description}>
{t('talk-plugin-auth.change_email.description')}
{t('talk-plugin-local-auth.change_email.description')}
</p>
<div className={styles.emailChange}>
<span className={styles.item}>
{t('talk-plugin-auth.change_email.old_email')}:{' '}
{t('talk-plugin-local-auth.change_email.old_email')}:{' '}
{this.props.emailAddress}
</span>
<span className={styles.item}>
{t('talk-plugin-auth.change_email.new_email')}:{' '}
{t('talk-plugin-local-auth.change_email.new_email')}:{' '}
{this.props.formData.newEmail}
</span>
</div>
<form>
<InputField
id="confirmPassword"
label={t('talk-plugin-auth.change_email.enter_password')}
label={t('talk-plugin-local-auth.change_email.enter_password')}
name="confirmPassword"
type="password"
onChange={this.props.onChange}
@@ -55,7 +55,9 @@ class ChangeEmailContentDialog extends React.Component {
hasError={
!this.props.formData.confirmPassword && this.state.showError
}
errorMsg={t('talk-plugin-auth.change_email.incorrect_password')}
errorMsg={t(
'talk-plugin-local-auth.change_email.incorrect_password'
)}
showError={this.state.showError}
columnDisplay
showSuccess={false}
@@ -63,13 +65,13 @@ class ChangeEmailContentDialog extends React.Component {
</form>
<div className={styles.bottomActions}>
<Button className={styles.cancel} onClick={this.props.cancel}>
{t('talk-plugin-auth.change_email.cancel')}
{t('talk-plugin-local-auth.change_email.cancel')}
</Button>
<Button
className={styles.confirmChanges}
onClick={this.confirmChanges}
>
{t('talk-plugin-auth.change_email.confirm_change')}
{t('talk-plugin-local-auth.change_email.confirm_change')}
</Button>
</div>
</div>
@@ -45,7 +45,9 @@ class ChangePassword extends React.Component {
const cond = this.state.formData[field] === this.state.formData[field2];
if (!cond) {
this.addError({
[field2]: t('talk-plugin-auth.change_password.passwords_dont_match'),
[field2]: t(
'talk-plugin-local-auth.change_password.passwords_dont_match'
),
});
} else {
this.removeError(field2);
@@ -56,7 +58,7 @@ class ChangePassword extends React.Component {
fieldValidation = (value, type, name) => {
if (!value.length) {
this.addError({
[name]: t('talk-plugin-auth.change_password.required_field'),
[name]: t('talk-plugin-local-auth.change_password.required_field'),
});
} else if (!validate[type](value)) {
this.addError({ [name]: errorMsj[type] });
@@ -113,7 +115,7 @@ class ChangePassword extends React.Component {
});
this.props.notify(
'success',
t('talk-plugin-auth.change_password.changed_password_msg')
t('talk-plugin-local-auth.change_password.changed_password_msg')
);
} catch (err) {
this.props.notify('error', getErrorMessages(err));
@@ -139,15 +141,19 @@ class ChangePassword extends React.Component {
return (
<section
className={cn('talk-plugin-auth--change-password', styles.container, {
[styles.editing]: editing,
})}
className={cn(
'talk-plugin-local-auth--change-password',
styles.container,
{
[styles.editing]: editing,
}
)}
>
<h3 className={styles.title}>
{t('talk-plugin-auth.change_password.change_password')}
{t('talk-plugin-local-auth.change_password.change_password')}
</h3>
{editing && (
<form className="talk-plugin-auth--change-password-form">
<form className="talk-plugin-local-auth--change-password-form">
<InputField
id="oldPassword"
label="Old Password"
@@ -161,7 +167,7 @@ class ChangePassword extends React.Component {
>
<span className={styles.detailBottomBox}>
<a className={styles.detailLink}>
{t('talk-plugin-auth.change_password.forgot_password')}
{t('talk-plugin-local-auth.change_password.forgot_password')}
</a>
</span>
</InputField>
@@ -197,16 +203,16 @@ class ChangePassword extends React.Component {
onClick={this.onSave}
disabled={this.isSubmitBlocked()}
>
{t('talk-plugin-auth.change_password.save')}
{t('talk-plugin-local-auth.change_password.save')}
</Button>
<a className={styles.cancelButton} onClick={this.cancel}>
{t('talk-plugin-auth.change_password.cancel')}
{t('talk-plugin-local-auth.change_password.cancel')}
</a>
</div>
) : (
<div className={styles.actions}>
<Button className={styles.button} onClick={this.enableEditing}>
{t('talk-plugin-auth.change_password.edit')}
{t('talk-plugin-local-auth.change_password.edit')}
</Button>
</div>
)}
@@ -25,7 +25,7 @@ class ChangeUsernameContentDialog extends React.Component {
if (!this.props.canUsernameBeUpdated) {
this.props.notify(
'error',
t('talk-plugin-auth.change_username.change_username_attempt')
t('talk-plugin-local-auth.change_username.change_username_attempt')
);
return;
}
@@ -44,19 +44,19 @@ class ChangeUsernameContentDialog extends React.Component {
×
</span>
<h1 className={styles.title}>
{t('talk-plugin-auth.change_username.confirm_username_change')}
{t('talk-plugin-local-auth.change_username.confirm_username_change')}
</h1>
<div className={styles.content}>
<p className={styles.description}>
{t('talk-plugin-auth.change_username.description')}
{t('talk-plugin-local-auth.change_username.description')}
</p>
<div className={styles.usernamesChange}>
<span className={styles.item}>
{t('talk-plugin-auth.change_username.old_username')}:{' '}
{t('talk-plugin-local-auth.change_username.old_username')}:{' '}
{this.props.username}
</span>
<span className={styles.item}>
{t('talk-plugin-auth.change_username.new_username')}:{' '}
{t('talk-plugin-local-auth.change_username.new_username')}:{' '}
{this.props.formData.newUsername}
</span>
</div>
@@ -70,7 +70,7 @@ class ChangeUsernameContentDialog extends React.Component {
defaultValue=""
hasError={this.formHasError() && this.state.showError}
errorMsg={t(
'talk-plugin-auth.change_username.username_does_not_match'
'talk-plugin-local-auth.change_username.username_does_not_match'
)}
showError={this.state.showError}
columnDisplay
@@ -78,19 +78,19 @@ class ChangeUsernameContentDialog extends React.Component {
validationType="username"
>
<span className={styles.bottomNote}>
{t('talk-plugin-auth.change_username.bottom_note')}
{t('talk-plugin-local-auth.change_username.bottom_note')}
</span>
</InputField>
</form>
<div className={styles.bottomActions}>
<Button className={styles.cancel} onClick={this.props.cancel}>
{t('talk-plugin-auth.change_username.cancel')}
{t('talk-plugin-local-auth.change_username.cancel')}
</Button>
<Button
className={styles.confirmChanges}
onClick={this.confirmChanges}
>
{t('talk-plugin-auth.change_username.confirm_changes')}
{t('talk-plugin-local-auth.change_username.confirm_changes')}
</Button>
</div>
</div>
@@ -26,7 +26,7 @@ class ChangeUsernameDialog extends React.Component {
if (!this.props.canUsernameBeUpdated) {
this.props.notify(
'error',
t('talk-plugin-auth.change_username.change_username_attempt')
t('talk-plugin-local-auth.change_username.change_username_attempt')
);
return;
}
@@ -42,25 +42,28 @@ class ChangeUsernameDialog extends React.Component {
return (
<Dialog
open={this.props.showDialog}
className={cn(styles.dialog, 'talk-plugin-auth--edit-profile-dialog')}
className={cn(
styles.dialog,
'talk-plugin-local-auth--edit-profile-dialog'
)}
>
<span className={styles.close} onClick={this.props.closeDialog}>
×
</span>
<h1 className={styles.title}>
{t('talk-plugin-auth.change_username.confirm_username_change')}
{t('talk-plugin-local-auth.change_username.confirm_username_change')}
</h1>
<div className={styles.content}>
<p className={styles.description}>
{t('talk-plugin-auth.change_username.description')}
{t('talk-plugin-local-auth.change_username.description')}
</p>
<div className={styles.usernamesChange}>
<span className={styles.item}>
{t('talk-plugin-auth.change_username.old_username')}:{' '}
{t('talk-plugin-local-auth.change_username.old_username')}:{' '}
{this.props.username}
</span>
<span className={styles.item}>
{t('talk-plugin-auth.change_username.new_username')}:{' '}
{t('talk-plugin-local-auth.change_username.new_username')}:{' '}
{this.props.formData.newUsername}
</span>
</div>
@@ -74,7 +77,7 @@ class ChangeUsernameDialog extends React.Component {
defaultValue=""
hasError={this.formHasError() && this.state.showError}
errorMsg={t(
'talk-plugin-auth.change_username.username_does_not_match'
'talk-plugin-local-auth.change_username.username_does_not_match'
)}
showError={this.state.showError}
columnDisplay
@@ -82,19 +85,19 @@ class ChangeUsernameDialog extends React.Component {
validationType="username"
>
<span className={styles.bottomNote}>
{t('talk-plugin-auth.change_username.bottom_note')}
{t('talk-plugin-local-auth.change_username.bottom_note')}
</span>
</InputField>
</form>
<div className={styles.bottomActions}>
<Button className={styles.cancel}>
{t('talk-plugin-auth.change_username.cancel')}
{t('talk-plugin-local-auth.change_username.cancel')}
</Button>
<Button
className={styles.confirmChanges}
onClick={this.confirmChanges}
>
{t('talk-plugin-auth.change_username.confirm_changes')}
{t('talk-plugin-local-auth.change_username.confirm_changes')}
</Button>
</div>
</div>
@@ -54,7 +54,10 @@ class ConfirmChangesDialog extends React.Component {
return (
<Dialog
open={this.props.showDialog}
className={cn(styles.dialog, 'talk-plugin-auth--edit-profile-dialog')}
className={cn(
styles.dialog,
'talk-plugin-local-auth--edit-profile-dialog'
)}
>
{this.renderSteps()}
</Dialog>
@@ -72,7 +72,7 @@ class Profile extends React.Component {
fieldValidation = (value, type, name) => {
if (!value.length) {
this.addError({
[name]: t('talk-plugin-auth.change_password.required_field'),
[name]: t('talk-plugin-local-auth.change_password.required_field'),
});
} else if (!validate[type](value)) {
this.addError({ [name]: errorMsj[type] });
@@ -127,7 +127,7 @@ class Profile extends React.Component {
await changeUsername(this.props.root.me.id, newUsername);
this.props.notify(
'success',
t('talk-plugin-auth.change_username.changed_username_success_msg')
t('talk-plugin-local-auth.change_username.changed_username_success_msg')
);
} catch (err) {
this.props.notify('error', getErrorMessages(err));
@@ -144,7 +144,7 @@ class Profile extends React.Component {
});
this.props.notify(
'success',
t('talk-plugin-auth.change_email.change_email_msg')
t('talk-plugin-local-auth.change_email.change_email_msg')
);
} catch (err) {
this.props.notify('error', getErrorMessages(err));
@@ -167,9 +167,13 @@ class Profile extends React.Component {
return (
<section
className={cn('talk-plugin-auth--edit-profile', styles.container, {
[styles.editing]: editing,
})}
className={cn(
'talk-plugin-local-auth--edit-profile',
styles.container,
{
[styles.editing]: editing,
}
)}
>
<ConfirmChangesDialog
showDialog={showDialog}
@@ -207,7 +211,9 @@ class Profile extends React.Component {
columnDisplay
>
<span className={styles.bottomText}>
{t('talk-plugin-auth.change_username.change_username_note')}
{t(
'talk-plugin-local-auth.change_username.change_username_note'
)}
</span>
</InputField>
<InputField
@@ -237,10 +243,10 @@ class Profile extends React.Component {
onClick={this.onSave}
disabled={!this.isSaveEnabled()}
>
{t('talk-plugin-auth.change_username.save')}
{t('talk-plugin-local-auth.change_username.save')}
</Button>
<a className={styles.cancelButton} onClick={this.cancel}>
{t('talk-plugin-auth.change_username.cancel')}
{t('talk-plugin-local-auth.change_username.cancel')}
</a>
</div>
) : (
@@ -250,7 +256,7 @@ class Profile extends React.Component {
icon="settings"
onClick={this.enableEditing}
>
{t('talk-plugin-auth.change_username.edit_profile')}
{t('talk-plugin-local-auth.change_username.edit_profile')}
</Button>
</div>
)}
@@ -0,0 +1,62 @@
en:
talk-plugin-local-auth:
change_password:
change_password: "Change Password"
passwords_dont_match: "Passwords don`t match"
required_field: "This field is required"
forgot_password: "Forgot your password?"
save: "Save"
cancel: "Cancel"
edit: "Edit"
changed_password_msg: "Changed Password - Your password has been successfully changed"
change_username:
change_username_note: "Usernames can be changed every 14 days"
save: "Save"
edit_profile: "Edit Profile"
cancel: "Cancel"
confirm_username_change: "Confirm Username Change"
description: "You are attempting to change your username. Your new username will appear on all of your past and future comments."
old_username: "Old Username"
new_username: "New Username"
bottom_note: "Note: You will not be able to change your username again for 14 days"
confirm_changes: "Confirm Changes"
username_does_not_match: "Username does not match"
cant_be_equal: "Your new {0} must be different to your current one"
change_username_attempt: "Username can't be updated. Usernames can be changed every 14 days"
change_email:
confirm_email_change: "Confirm Email Address Change"
description: "You are attempting to change your email address. Your new email address will be used for your login and to receive account notifications."
old_email: "Old Email Address"
new_email: "New Email Address"
enter_password: "Enter Password"
incorrect_password: "Incorrect Password"
confirm_change: "Confirm Change"
cancel: "Cancel"
change_email_msg: "Email Address Changed - Your email address has been successfully changed. This email address will now be used for signing in and email notifications."
changed_username_success_msg: "Username Changed - Your username has been successfully changed. You will not be able to change your user name for 14 days."
change_username_attempt: "Username can't be updated. Usernames can only be changed every 14 days."
es:
talk-plugin-local-auth:
change_password:
change_password: "Cambiar Contraseña"
passwords_dont_match: "Las contraseñas no coinciden"
required_field: "Este campo es requerido"
forgot_password: "Olvidaste tu contraseña?"
save: "Guardar"
cancel: "Cancelar"
edit: "Editar"
changed_password_msg: "Contraseña Actualizada - Tu contraseña ha sido exitosamente actualizada"
change_username:
change_username_note: "El usuario puede ser cambiado cada 14 días"
save: "Guardar"
edit_profile: "Editar Perfil"
cancel: "Cancelar"
confirm_username_change: "Confirmar Cambio de Usuario"
description: "Estás intentando cambiar tu usuario. Tu nuevo usuario aparecerá en todos tus pasados y futuros comentarios."
old_username: "Usuario viejo"
new_username: "Usuario nuevo"
bottom_note: "Nota: No podrás cambiar tu usuario por 14 días"
confirm_changes: "Confirmar Cambios"
username_does_not_match: "El usuario no coincide"
changed_username_success_msg: "Usuario Actualizado - Tu usuario ha sido exitosamente actualizado. No podrás cambiar el usuario por 14 días."
change_username_attempt: "El usuario no puede ser actualizado. Los usuarios pueden ser cambiados cada 14 días."