diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 7da6984..e474311 100755 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -59,5 +59,29 @@ "services": { "fork": "Не удалось выполнить авторизацию в сервисе" } + }, + "articlePage": { + "abstract": "Введение", + "keywords": "Ключевые слова" + }, + "navbar": { + "createNew": "Создать статью", + "about": { + "navTitle": "О проекте", + "aboutProject": "О Scipaper", + "contacts": "Контакты", + "help": "Помощь" + }, + "library": { + "navTitle": "Моя библиотека", + "publications": "Публикации", + "favorites": "Избранное", + "collections": "Коллекции", + "recentViewed": "История" + }, + "auth": { + "signIn": "Вход", + "signUp": "Регистрация" + } } } \ No newline at end of file diff --git a/src/components/ArticleSearchResult.tsx b/src/components/ArticleSearchResult.tsx index d06fd3a..bce62e9 100644 --- a/src/components/ArticleSearchResult.tsx +++ b/src/components/ArticleSearchResult.tsx @@ -37,7 +37,7 @@ export const ArticleSearchResult = ({ searchItem }: Props) => { - + {searchItem.title} diff --git a/src/components/fetchAnArticle/AnArticle.tsx b/src/components/fetchAnArticle/AnArticle.tsx index 54d35d8..240d53c 100644 --- a/src/components/fetchAnArticle/AnArticle.tsx +++ b/src/components/fetchAnArticle/AnArticle.tsx @@ -8,10 +8,13 @@ import Container from "components/Container"; import NotFound from "./NotFound"; import { SVGSearch } from "components/icons"; import BaseLayout from "components/BaseLayout"; +import Typography from "components/typography/Typography"; +import { useTranslation } from "react-i18next"; const AnArticle = () => { const store = useArticleStore(); const { article, hasError, shouldShowLoading } = useArticleViewModel(store); + const { i18n, t } = useTranslation(); const { id } = useParams(); const newId = `${id}`; @@ -46,9 +49,13 @@ const AnArticle = () => { {article?.tags && (
- - Keywords - + + {t('articlePage.keywords')} + + {article?.tags} @@ -56,9 +63,12 @@ const AnArticle = () => {
)}
- - Abstract - + + {t('articlePage.abstract')} + {article?.summary !== undefined ? ( article?.summary diff --git a/src/components/parts/Header.tsx b/src/components/parts/Header.tsx index 2cdd0f3..cae9eaf 100755 --- a/src/components/parts/Header.tsx +++ b/src/components/parts/Header.tsx @@ -1,5 +1,5 @@ import classNames from "classnames"; -import { useState } from "react"; +import { useState, useTransition } from "react"; /* -------------------------------------------------------------------------- */ /* Components */ /* -------------------------------------------------------------------------- */ @@ -23,11 +23,14 @@ import { SVGFile, SVGEye, } from "components/icons"; +import i18n from "localization/i18n"; +import { useTranslation } from "react-i18next"; const Header = () => { const [authenticated, setAuthenticated] = useState(false); const onClick = () => setAuthenticated(true); const [notification, setNotification] = useState(false); + const { t, i18n } = useTranslation(); /* -------------------------------------------------------------------------- */ /* Implement Header Component */ @@ -66,36 +69,36 @@ const Header = () => { className="text-blue-500 px-4 font-bold uppercase" to="/create-new" > - Create new + {t('navbar.createNew')} {/* Link Create now - end - */} {/* Dropdown Menu My library - start - */} console.log("My publications")} icon={} > console.log("My Favorites")} icon={} > console.log("My Collections")} icon={} > console.log("Recent Viewed")} icon={} > @@ -105,21 +108,21 @@ const Header = () => { {/* Dropdown Menu About - start - */} console.log("About Freeland")} > console.log("Contact Us")} > console.log("Help")} > @@ -132,38 +135,38 @@ const Header = () => {
{!authenticated ? [ - , - , - ] + , + , + ] : [ - , + , - , - ]} + , + ]} {/* Burger component will be shown for the small screens */}
diff --git a/src/index.tsx b/src/index.tsx index 5444a2c..ed9b2e9 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -16,6 +16,7 @@ import AccountSettings from "pages/Information/AccountSettings"; import { store } from "store/store"; import { Provider } from "react-redux"; import { SearchResultsPage } from "pages/SearchResultsPage"; +import AnArticle from "components/fetchAnArticle/AnArticle"; const rootElement = document.getElementById("root"); if (!rootElement) throw new Error("Failed to find the root element"); @@ -32,6 +33,7 @@ root.render( } /> } /> } /> + } /> } /> diff --git a/src/localization/i18n.ts b/src/localization/i18n.ts index c97eeb4..d735183 100755 --- a/src/localization/i18n.ts +++ b/src/localization/i18n.ts @@ -18,11 +18,11 @@ export const languages: Record = { }, }; export const popularLangKeys = ["ru", "en"]; -const fallbackLng: Langs = "en"; +const fallbackLng: Langs = "ru"; i18n .use(Backend) - .use(LanguageDetector) + // .use(LanguageDetector) .use(initReactI18next) .init({ debug: process.env.NODE_ENV === "development" ? true : false,