web: Client: Added translation of About page
This commit is contained in:
parent
51a39a34d1
commit
b5c18d8058
@ -31,6 +31,9 @@ if (process.env.NODE_ENV === "production") {
|
||||
const resources = {
|
||||
en: {
|
||||
translation: require("./locales/en/translation.json")
|
||||
},
|
||||
ru: {
|
||||
translation: require("./locales/ru/translation.json")
|
||||
}
|
||||
};
|
||||
|
||||
@ -49,7 +52,7 @@ if (process.env.NODE_ENV === "production") {
|
||||
},
|
||||
|
||||
react: {
|
||||
useSuspense: true
|
||||
useSuspense: false
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { PageLayout, Text, Link } from "asc-web-components";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import i18n from "./i18n";
|
||||
@ -53,9 +54,13 @@ const VersionStyle = styled.div`
|
||||
padding: 8px 0px 20px 0px;
|
||||
`;
|
||||
|
||||
const Body = () => {
|
||||
const Body = ({language}) => {
|
||||
const { t } = useTranslation("translation", { i18n });
|
||||
|
||||
useEffect(() => {
|
||||
i18n.changeLanguage(language);
|
||||
}, [language]);
|
||||
|
||||
return (
|
||||
<BodyStyle>
|
||||
<p style={{ textAlign: "center", margin: "0px" }}>
|
||||
@ -153,8 +158,12 @@ const Body = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const About = () => {
|
||||
return <PageLayout sectionBodyContent={<Body />} />;
|
||||
};
|
||||
const About = ({language}) => <PageLayout sectionBodyContent={<Body language={language} />} />;
|
||||
|
||||
export default About;
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
language: state.auth.user.cultureName || state.auth.settings.culture,
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(About);
|
||||
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"AboutCompanyTitle": "О программе",
|
||||
"AboutCompanyVersion": "Версия",
|
||||
"AboutCompanyLicensor": "АВТОРСКИЕ ПРАВА",
|
||||
"AboutCompanyAddressTitle": "адрес",
|
||||
"AboutCompanyEmailTitle": "email",
|
||||
"AboutCompanyTelTitle": "тел.",
|
||||
"LicensedUnder": "Это программное обеспечение лицензируется под", "_comment": "{0}GNU GPL v.3{1}",
|
||||
"SourceCode": "Исходный код программы доступен по cсылке", "_comment": "{0}GNU GPL v.3{1}","_comment":"SYNTAX ERROR"
|
||||
}
|
Loading…
Reference in New Issue
Block a user