From b9d57fb5ddd36575b2f59be2a98f57c921005f4f Mon Sep 17 00:00:00 2001 From: Youngbin Han Date: Mon, 12 Feb 2024 18:42:27 +0900 Subject: [PATCH] =?UTF-8?q?=EC=96=B8=EC=96=B4=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EB=A9=94=EB=89=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.ts | 24 +++++++++++++++++------- src/layouts/Shell.astro | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/config.ts b/src/config.ts index 1cd3b15..c49f00e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,8 @@ import UbuntuKoreaLogo from "@assets/UbuntuKorea.svg" import GroupPhoto2023 from "@assets/group_photo.jpg" import { useTranslations } from "@i18n/utils"; +import { languages } from '@i18n/ui'; + export const config = { siteTitle: "UbuCon Korea 2024", @@ -35,7 +37,7 @@ export const config = { { name: "Ubuntu Korea Community", logoImage: UbuntuKoreaLogo.src, link: "https://ubuntu-kr.org" } ] }, - navigation: (locale: string)=>{ + navigation: (locale: string) => { const t = useTranslations(locale); return [ { @@ -82,10 +84,18 @@ export const config = { } ] }, - navigationRight: [ - { - label: 'Register', - url: '#' - } - ] + navigationRight: (locale: string) => { + const t = useTranslations(locale); + const langPickerItems = Object.entries(languages).map(([lang, label]) => ({ label: label, url: `/${lang}/` })); + return [ + { + label: '🎟️', + url: '#' + }, + { + label: '🌐', + items: langPickerItems + } + ] + } } \ No newline at end of file diff --git a/src/layouts/Shell.astro b/src/layouts/Shell.astro index 2fc8e5a..08b02a8 100644 --- a/src/layouts/Shell.astro +++ b/src/layouts/Shell.astro @@ -22,7 +22,7 @@ const t = useTranslations(lang);