web: Client: Added translation of Error page
This commit is contained in:
parent
b8b0692f85
commit
51a39a34d1
@ -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")
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"Error404Text": "Извините, страница не найдена."
|
||||
}
|
Loading…
Reference in New Issue
Block a user