web: Client: Added translation of Error page

This commit is contained in:
Alexey Safronov 2019-09-30 12:30:26 +03:00
parent b8b0692f85
commit 51a39a34d1
3 changed files with 24 additions and 3 deletions

View File

@ -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")
}
};

View File

@ -1,9 +1,24 @@
import React from 'react';
import React, { useEffect } from 'react';
import { connect } from "react-redux";
import { ErrorContainer } from 'asc-web-components';
import { useTranslation } from 'react-i18next';
import i18n from './i18n';
export const Error404 = () => {
const Error404Container = ({language}) => {
const { t } = useTranslation('translation', { i18n });
useEffect(() => {
i18n.changeLanguage(language);
}, [language]);
return <ErrorContainer>{t("Error404Text")}</ErrorContainer>;
};
function mapStateToProps(state) {
return {
language: state.auth.user.cultureName || state.auth.settings.culture,
};
}
export const Error404 = connect(mapStateToProps)(Error404Container);

View File

@ -0,0 +1,3 @@
{
"Error404Text": "Извините, страница не найдена."
}