mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
update translation
This commit is contained in:
@@ -26,5 +26,17 @@
|
|||||||
},
|
},
|
||||||
"user-form": {
|
"user-form": {
|
||||||
"submit": "Submit"
|
"submit": "Submit"
|
||||||
|
},
|
||||||
|
"add-user": {
|
||||||
|
"title": "Create User",
|
||||||
|
"subtitle": "Create a new user"
|
||||||
|
},
|
||||||
|
"single-user": {
|
||||||
|
"error-title": "Error",
|
||||||
|
"error-subtitle": "Unknown user error",
|
||||||
|
"navigation-label": "Navigation",
|
||||||
|
"actions-label": "Actions",
|
||||||
|
"information-label": "Information",
|
||||||
|
"back-label": "Back"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ import type { User } from "../types/User";
|
|||||||
import type { History } from "history";
|
import type { History } from "history";
|
||||||
import { createUser } from "../modules/users";
|
import { createUser } from "../modules/users";
|
||||||
import { Page } from "../../components/layout";
|
import { Page } from "../../components/layout";
|
||||||
|
import { translate } from "react-i18next";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
t: string => string,
|
||||||
addUser: (user: User, callback?: () => void) => void,
|
addUser: (user: User, callback?: () => void) => void,
|
||||||
loading?: boolean,
|
loading?: boolean,
|
||||||
error?: Error,
|
error?: Error,
|
||||||
@@ -25,13 +27,12 @@ class AddUser extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { loading, error } = this.props;
|
const { t, loading, error } = this.props;
|
||||||
|
|
||||||
// TODO i18n
|
|
||||||
return (
|
return (
|
||||||
<Page
|
<Page
|
||||||
title="Create User"
|
title={t("add-user.title")}
|
||||||
subtitle="Create a new user"
|
subtitle={t("add-user.subtitle")}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
error={error}
|
error={error}
|
||||||
>
|
>
|
||||||
@@ -59,4 +60,4 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(AddUser);
|
)(translate("users")(AddUser));
|
||||||
|
|||||||
@@ -14,8 +14,11 @@ import Loading from "../../components/Loading";
|
|||||||
import { Navigation, Section, NavLink } from "../../components/navigation";
|
import { Navigation, Section, NavLink } from "../../components/navigation";
|
||||||
import { DeleteUserNavLink, EditUserNavLink } from "./../components/navLinks";
|
import { DeleteUserNavLink, EditUserNavLink } from "./../components/navLinks";
|
||||||
import ErrorPage from "../../components/ErrorPage";
|
import ErrorPage from "../../components/ErrorPage";
|
||||||
|
import { translate } from "react-i18next";
|
||||||
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
t: string => string,
|
||||||
name: string,
|
name: string,
|
||||||
userEntry?: UserEntry,
|
userEntry?: UserEntry,
|
||||||
match: any,
|
match: any,
|
||||||
@@ -49,7 +52,7 @@ class SingleUser extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { userEntry } = this.props;
|
const { t, userEntry } = this.props;
|
||||||
|
|
||||||
if (!userEntry || userEntry.loading) {
|
if (!userEntry || userEntry.loading) {
|
||||||
return <Loading />;
|
return <Loading />;
|
||||||
@@ -58,8 +61,8 @@ class SingleUser extends React.Component<Props> {
|
|||||||
if (userEntry.error) {
|
if (userEntry.error) {
|
||||||
return (
|
return (
|
||||||
<ErrorPage
|
<ErrorPage
|
||||||
title="Error"
|
title={t("single-user.error-title")}
|
||||||
subtitle="Unknown user error"
|
subtitle={t("single-user.error-subtitle")}
|
||||||
error={userEntry.error}
|
error={userEntry.error}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -68,8 +71,6 @@ class SingleUser extends React.Component<Props> {
|
|||||||
const user = userEntry.entry;
|
const user = userEntry.entry;
|
||||||
const url = this.matchedUrl();
|
const url = this.matchedUrl();
|
||||||
|
|
||||||
// TODO i18n
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page title={user.displayName}>
|
<Page title={user.displayName}>
|
||||||
<div className="columns">
|
<div className="columns">
|
||||||
@@ -82,13 +83,13 @@ class SingleUser extends React.Component<Props> {
|
|||||||
</div>
|
</div>
|
||||||
<div className="column">
|
<div className="column">
|
||||||
<Navigation>
|
<Navigation>
|
||||||
<Section label="Navigation">
|
<Section label={t("single-user.navigation-label")}>
|
||||||
<NavLink to={`${url}`} label="Information" />
|
<NavLink to={`${url}`} label={t("single-user.information-label")} />
|
||||||
<EditUserNavLink user={user} editUrl={`${url}/edit`} />
|
<EditUserNavLink user={user} editUrl={`${url}/edit`} />
|
||||||
</Section>
|
</Section>
|
||||||
<Section label="Actions">
|
<Section label={t("single-user.actions-label")}>
|
||||||
<DeleteUserNavLink user={user} deleteUser={this.deleteUser} />
|
<DeleteUserNavLink user={user} deleteUser={this.deleteUser} />
|
||||||
<NavLink to="/users" label="Back" />
|
<NavLink to="/users" label={t("single-user.back-label")} />
|
||||||
</Section>
|
</Section>
|
||||||
</Navigation>
|
</Navigation>
|
||||||
</div>
|
</div>
|
||||||
@@ -125,4 +126,4 @@ const mapDispatchToProps = dispatch => {
|
|||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(SingleUser);
|
)(translate("users")(SingleUser));
|
||||||
|
|||||||
Reference in New Issue
Block a user