fix #435 remove i18n (#451)

* fix #435 remove i18n
This commit is contained in:
Kalidou Diagne
2025-06-12 23:30:32 +08:00
committed by GitHub
parent a32832746c
commit fd0d52b6ec
135 changed files with 767 additions and 2813 deletions

View File

@@ -1,18 +1,10 @@
import { MainNavProps } from "@/components/main-nav"
import { useTranslation } from "@/app/i18n/client"
import { LocaleTypes, fallbackLng, languageList } from "@/app/i18n/settings"
export function useAppSettings(lang: LocaleTypes) {
const { t } = useTranslation(lang, "common")
// get the active language label
const activeLanguage =
languageList.find((language) => language.key === lang)?.label ??
languageList.find((language) => language.key === fallbackLng)?.label
import { LABELS } from "@/app/labels"
export function useAppSettings() {
const MAIN_NAV: MainNavProps["items"] = [
{
title: t("menu.home"),
title: LABELS.COMMON.MENU.HOME,
href: "/",
onlyMobile: true,
},
@@ -22,28 +14,28 @@ export function useAppSettings(lang: LocaleTypes) {
onlyFooter: true,
},
{
title: t("menu.projects"),
title: LABELS.COMMON.MENU.PROJECTS,
href: "/projects",
},
{
title: t("menu.research"),
title: LABELS.COMMON.MENU.RESEARCH,
href: "/research",
},
{
title: t("menu.programs"),
title: LABELS.COMMON.MENU.PROGRAMS,
href: "/programs",
onlyFooter: true,
},
{
title: t("menu.about"),
title: LABELS.COMMON.MENU.ABOUT,
href: "/about",
},
{
title: t("menu.resources"),
title: LABELS.COMMON.MENU.RESOURCES,
href: "/resources",
},
{
title: t("menu.blog"),
title: LABELS.COMMON.MENU.BLOG,
href: "/blog",
onlyHeader: true,
},
@@ -51,6 +43,5 @@ export function useAppSettings(lang: LocaleTypes) {
return {
MAIN_NAV,
activeLanguageLabel: activeLanguage,
}
}