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 = () => ( -
Welcome to your new single-page application, built with:
-To help you get started, we've also set up:
-create-react-app
runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.dotnet publish
configuration produces minified, efficiently bundled JavaScript files.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
.
+ +
+ +