Web.Client: Settings: access rights: added translations

This commit is contained in:
Daniil Senkiv 2020-01-26 14:45:11 +03:00
parent 9d82e657ed
commit d0eebbe6fd
5 changed files with 35 additions and 15 deletions

View File

@ -1,15 +1,17 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import { withRouter } from "react-router";
import i18n from "../../i18n";
import { I18nextProvider, withTranslation } from "react-i18next";
import styled from "styled-components";
import { TabContainer } from "asc-web-components";
import { utils } from 'asc-web-common';
import OwnerSettings from "./sub-components/owner";
import AdminsSettings from "./sub-components/admins";
// import ModulesSettings from "./sub-components/modules";
const { changeLanguage } = utils;
const MainContainer = styled.div`
padding-bottom: 16px;
width: 100%;
@ -43,8 +45,6 @@ class PureAccessRights extends Component {
};
}
componentDidMount() {}
onSelectPage = page => {
const { history } = this.props;
@ -76,6 +76,7 @@ class PureAccessRights extends Component {
render() {
const { isLoading, selectedTab } = this.state;
const { t } = this.props;
console.log("accessRight render_");
@ -89,12 +90,12 @@ class PureAccessRights extends Component {
{[
{
key: "0",
title: "Owner settings",
title: t('OwnerSettings'),
content: <OwnerSettings />
},
{
key: "1",
title: "Admins settings",
title: t('AdminsSettings'),
content: <AdminsSettings />
},
// {
@ -112,9 +113,8 @@ class PureAccessRights extends Component {
const AccessRightsContainer = withTranslation()(PureAccessRights);
const AccessRights = props => {
const { language } = props;
i18n.changeLanguage(language);
changeLanguage(i18n);
return (
<I18nextProvider i18n={i18n}>
@ -123,4 +123,4 @@ const AccessRights = props => {
);
};
export default connect(null, {})(withRouter(AccessRights));
export default withRouter(AccessRights);

View File

@ -366,7 +366,7 @@ class PureAdminsSettings extends Component {
id="people-admin-selector_button"
size="medium"
primary={true}
label="Set people admin"
label={t('SetPeopleAdmin')}
isDisabled={isLoading}
onClick={this.onShowGroupSelector}
/>
@ -384,7 +384,7 @@ class PureAdminsSettings extends Component {
id="full-admin-selector_button"
size="medium"
primary={true}
label="Set portal admin"
label={t('SetPortalAdmin')}
isDisabled={isLoading}
onClick={this.onShowFullAdminGroupSelector}
/>
@ -404,6 +404,8 @@ class PureAdminsSettings extends Component {
getFilterData={() => []}
getSortData={this.getSortData}
onFilter={this.onFilter}
directionAscLabel={t("DirectionAscLabel")}
directionDescLabel={t("DirectionDescLabel")}
/>
{admins.length > 0 ? (
@ -445,8 +447,8 @@ class PureAdminsSettings extends Component {
<Text>
{user.isAdmin
? "Full access"
: "People module admin"}
? t('PortalAdmin')
: t('PeopleAdmin')}
</Text>
{!user.isOwner ? (

View File

@ -216,7 +216,7 @@ class PureOwnerSettings extends Component {
className="button_offset"
size="medium"
primary={true}
label="Change portal owner"
label={t('ChangePortalOwner')}
isDisabled={!isLoading ? selectedOwner === null : false}
onClick={this.onChangeOwner}
/>

View File

@ -86,5 +86,14 @@
"CountPerPage": "{{count}} per page",
"PageOfTotalPage": "{{page}} of {{totalPage}}",
"ByFirstNameSorting": "By first name",
"ByLastNameSorting": "By last name"
"ByLastNameSorting": "By last name",
"OwnerSettings": "Owner settings",
"AdminsSettings": "Admins settings",
"ChangePortalOwner": "Change portal owner",
"SetPeopleAdmin": "Set people admin",
"SetPortalAdmin": "Set portal admin",
"PortalAdmin": "Full access",
"PeopleAdmin": "People module admin",
"DirectionAscLabel":"A-Z",
"DirectionDescLabel":"Z-A"
}

View File

@ -86,5 +86,14 @@
"CountPerPage": "{{count}} на странице",
"PageOfTotalPage": "{{page}} из {{totalPage}}",
"ByFirstNameSorting": "По имени",
"ByLastNameSorting": "По фамилии"
"ByLastNameSorting": "По фамилии",
"OwnerSettings": "Настройки владельца портата",
"AdminsSettings": "Настройки администраторов",
"ChangePortalOwner": "Сменить владельца портала",
"SetPeopleAdmin": "Установить администратора модуля Люди",
"SetPortalAdmin": "Установить администратора портала",
"PortalAdmin": "Администратор портала",
"PeopleAdmin": "Администратор модуля Люди",
"DirectionAscLabel":"А-Я",
"DirectionDescLabel":"Я-А"
}