mirror of
https://github.com/privacy-scaling-explorations/pse.dev.git
synced 2026-01-10 06:38:03 -05:00
update language settings
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { MainNavProps } from "@/components/main-nav"
|
||||
import { useTranslation } from "@/app/i18n/client"
|
||||
import { LocaleTypes } from "@/app/i18n/settings"
|
||||
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
|
||||
|
||||
const MAIN_NAV: MainNavProps["items"] = [
|
||||
{
|
||||
title: t("menu.home"),
|
||||
@@ -48,5 +54,6 @@ export function useAppSettings(lang: LocaleTypes) {
|
||||
|
||||
return {
|
||||
MAIN_NAV,
|
||||
activeLanguageLabel: activeLanguage,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user