Fixed i18n

This commit is contained in:
Philipp Czora
2018-11-09 15:43:36 +01:00
parent 4702666628
commit 2e8de0ed23
3 changed files with 16 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
// @flow
import React from "react";
import { translate } from "react-i18next";
import {translate} from "react-i18next";
import InputField from "./InputField";
type State = {
@@ -42,7 +42,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
return (
<>
<InputField
label={t("password.label")}
label={t("password.newPassword")}
type="password"
onChange={this.handlePasswordChange}
value={this.state.password ? this.state.password : ""}

View File

@@ -52,10 +52,15 @@
},
"password": {
"label": "Password",
"newPassword": "New password",
"passwordHelpText": "Plain text password of the user.",
"passwordConfirmHelpText": "Repeat the password for confirmation.",
"currentPassword": "Current password",
"currentPasswordHelpText": "The password currently in use",
"confirmPassword": "Confirm password",
"passwordInvalid": "Password has to be between 6 and 32 characters",
"passwordConfirmFailed": "Passwords have to be identical"
"passwordConfirmFailed": "Passwords have to be identical",
"submit": "Submit",
"changedSuccessfully": "Pasword successfully changed"
}
}

View File

@@ -7,9 +7,9 @@ import {
PasswordConfirmation,
SubmitButton
} from "@scm-manager/ui-components";
import { translate } from "react-i18next";
import type { Me } from "@scm-manager/ui-types";
import { changePassword } from "../modules/changePassword";
import {translate} from "react-i18next";
import type {Me} from "@scm-manager/ui-types";
import {changePassword} from "../modules/changePassword";
type Props = {
me: Me,
@@ -93,7 +93,7 @@ class ChangeUserPassword extends React.Component<Props, State> {
message = (
<Notification
type={"success"}
children={t("password.set-password-successful")}
children={t("password.changedSuccessfully")}
onClose={() => this.onClose()}
/>
);
@@ -105,13 +105,13 @@ class ChangeUserPassword extends React.Component<Props, State> {
<form onSubmit={this.submit}>
{message}
<InputField
label={t("password.current-password")}
label={t("password.currentPassword")}
type="password"
onChange={oldPassword =>
this.setState({ ...this.state, oldPassword })
}
value={this.state.oldPassword ? this.state.oldPassword : ""}
helpText={t("help.currentPasswordHelpText")}
helpText={t("password.currentPasswordHelpText")}
/>
<PasswordConfirmation
passwordChanged={this.passwordChanged}
@@ -120,7 +120,7 @@ class ChangeUserPassword extends React.Component<Props, State> {
<SubmitButton
disabled={!this.state.password}
loading={loading}
label={t("user-form.submit")}
label={t("password.submit")}
/>
</form>
);
@@ -138,4 +138,4 @@ class ChangeUserPassword extends React.Component<Props, State> {
};
}
export default translate("users")(ChangeUserPassword);
export default translate("commons")(ChangeUserPassword);