diff --git a/scm-ui/public/locales/en/users.json b/scm-ui/public/locales/en/users.json index 7f8e026fb9..2949b4fd2b 100644 --- a/scm-ui/public/locales/en/users.json +++ b/scm-ui/public/locales/en/users.json @@ -26,5 +26,17 @@ }, "user-form": { "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" } } diff --git a/scm-ui/src/users/containers/AddUser.js b/scm-ui/src/users/containers/AddUser.js index 54a5f7b419..df7baccde9 100644 --- a/scm-ui/src/users/containers/AddUser.js +++ b/scm-ui/src/users/containers/AddUser.js @@ -6,8 +6,10 @@ import type { User } from "../types/User"; import type { History } from "history"; import { createUser } from "../modules/users"; import { Page } from "../../components/layout"; +import { translate } from "react-i18next"; type Props = { + t: string => string, addUser: (user: User, callback?: () => void) => void, loading?: boolean, error?: Error, @@ -25,13 +27,12 @@ class AddUser extends React.Component { }; render() { - const { loading, error } = this.props; + const { t, loading, error } = this.props; - // TODO i18n return ( @@ -59,4 +60,4 @@ const mapStateToProps = (state, ownProps) => { export default connect( mapStateToProps, mapDispatchToProps -)(AddUser); +)(translate("users")(AddUser)); diff --git a/scm-ui/src/users/containers/SingleUser.js b/scm-ui/src/users/containers/SingleUser.js index 3ba758c503..d4897b4fd7 100644 --- a/scm-ui/src/users/containers/SingleUser.js +++ b/scm-ui/src/users/containers/SingleUser.js @@ -14,8 +14,11 @@ import Loading from "../../components/Loading"; import { Navigation, Section, NavLink } from "../../components/navigation"; import { DeleteUserNavLink, EditUserNavLink } from "./../components/navLinks"; import ErrorPage from "../../components/ErrorPage"; +import { translate } from "react-i18next"; + type Props = { + t: string => string, name: string, userEntry?: UserEntry, match: any, @@ -49,7 +52,7 @@ class SingleUser extends React.Component { }; render() { - const { userEntry } = this.props; + const { t, userEntry } = this.props; if (!userEntry || userEntry.loading) { return ; @@ -58,8 +61,8 @@ class SingleUser extends React.Component { if (userEntry.error) { return ( ); @@ -68,8 +71,6 @@ class SingleUser extends React.Component { const user = userEntry.entry; const url = this.matchedUrl(); - // TODO i18n - return (
@@ -82,13 +83,13 @@ class SingleUser extends React.Component {
-
- +
+
-
+
- +
@@ -125,4 +126,4 @@ const mapDispatchToProps = dispatch => { export default connect( mapStateToProps, mapDispatchToProps -)(SingleUser); +)(translate("users")(SingleUser));