diff --git a/web/ASC.Web.Client/src/components/pages/About/i18n.js b/web/ASC.Web.Client/src/components/pages/About/i18n.js new file mode 100644 index 0000000000..9da7cbdbb3 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/About/i18n.js @@ -0,0 +1,57 @@ +import i18n from "i18next"; +import Backend from "i18next-xhr-backend"; + +const newInstance = i18n.createInstance(); + +if (process.env.NODE_ENV === "production") { + newInstance + .use(Backend) + .init({ + lng: 'en', + fallbackLng: "en", + debug: true, + + interpolation: { + escapeValue: false, // not needed for react as it escapes by default + format: function (value, format) { + if (format === 'lowercase') return value.toLowerCase(); + return value; + } + }, + + react: { + useSuspense: true + }, + backend: { + loadPath: `/locales/About/{{lng}}/{{ns}}.json` + } + }); +} else if (process.env.NODE_ENV === "development") { + + const resources = { + en: { + translation: require("./locales/en/translation.json") + } + }; + + newInstance.init({ + resources: resources, + lng: 'en', + fallbackLng: "en", + debug: true, + + interpolation: { + escapeValue: false, // not needed for react as it escapes by default + format: function (value, format) { + if (format === 'lowercase') return value.toLowerCase(); + return value; + } + }, + + react: { + useSuspense: true + } + }); +} + +export default newInstance; \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/pages/About/index.js b/web/ASC.Web.Client/src/components/pages/About/index.js index 5b8b767b35..e65d471c04 100644 --- a/web/ASC.Web.Client/src/components/pages/About/index.js +++ b/web/ASC.Web.Client/src/components/pages/About/index.js @@ -1,22 +1,179 @@ -import React from 'react'; +import React from "react"; +import { PageLayout, Text, Link } from "asc-web-components"; +import { useTranslation } from "react-i18next"; +import i18n from "./i18n"; +import version from "../../../../package.json"; +import styled from "styled-components"; -const About = () => ( -
-

Hello, world!

-

Welcome to your new single-page application, built with:

- -

To help you get started, we've also set up:

- -

The ClientApp subdirectory is a standard React application based on the create-react-app template. If you open a command prompt in that directory, you can run npm commands such as npm test or npm install.

-
-); +const BodyStyle = styled.div` + .text_p { + text-align: center; + } + .text_span { + text-align: center; + } + + .logo-img { + text-align: center; + max-width: 216px; + max-height: 35px; + } + + .copyright-line { + padding-bottom: 15px; + text-align: center; + + :before { + background-color: #e1e1e1; + content: ""; + height: 2px; + margin-top: 9px; + width: 36%; + float: right; + } + + :after { + background-color: #e1e1e1; + content: ""; + height: 2px; + margin-top: 9px; + width: 36%; + float: left; + } + } +`; + +const TitleStyle = styled.div` + padding: 8px; +`; + +const Style = styled.div` + margin-top: 8px; + text-align: center; +`; + +const VersionStyle = styled.div` + padding: 8px 0px 20px 0px; +`; + +const Title = () => { + const { t } = useTranslation("translation", { i18n }); + return ( + + + {t("AboutCompanyTitle")} + + + ); +}; + +const Body = () => { + const { t } = useTranslation("translation", { i18n }); + + return ( + +

+ Logo +

+ + + + {`${t("AboutCompanyVersion")}: ${version.version}`} + + + + + {t("AboutCompanyLicensor")} + + + + Ascensio System SIA + + + +
+ ); +}; + +const About = () => { + return ( + } + sectionBodyContent={} + /> + ); +}; export default About; diff --git a/web/ASC.Web.Client/src/components/pages/About/locales/en/translation.json b/web/ASC.Web.Client/src/components/pages/About/locales/en/translation.json new file mode 100644 index 0000000000..17bdd79d28 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/About/locales/en/translation.json @@ -0,0 +1,14 @@ +{ + "AboutCompanyTitle": "About this program", + "AboutCompanyVersion": "Version", + "AboutCompanyLicensor": "Copyright", + "AboutCompanyAddressTitle": "address", + "AboutCompanyEmailTitle": "email", + "AboutCompanyTelTitle": "tel.", + "LicensedUnder": "This software is licensed under ", "_comment": "{0}GNU GPL v.3{1}", + + + + + "SourceCode": "Source code is available on ", "_comment": "{0}GNU GPL v.3{1}" +} \ No newline at end of file diff --git a/web/ASC.Web.Client/src/resourceConfig.json b/web/ASC.Web.Client/src/resourceConfig.json index 7fffdf64ef..743666a7af 100644 --- a/web/ASC.Web.Client/src/resourceConfig.json +++ b/web/ASC.Web.Client/src/resourceConfig.json @@ -1,6 +1,17 @@ { "pages": { "About": { + "Resource": [ + "AboutCompanyTitle", + "AboutCompanyVersion", + "AboutCompanyLicensor", + "AboutCompanyAddressTitle", + "AboutCompanyEmailTitle", + "AboutCompanyTelTitle" + ], + "UserControlsCommonResource": [ + "LicensedUnder" + ] }, "Home": { },