Skip to content

Commit

Permalink
언어 선택 메뉴 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sukso96100 committed Feb 12, 2024
1 parent 40afe35 commit b9d57fb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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 [
{
Expand Down Expand Up @@ -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
}
]
}
}
2 changes: 1 addition & 1 deletion src/layouts/Shell.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const t = useTranslations(lang);
<GlobalNavigation
logoTitle={config.siteTitle}
navItems={config.navigation(lang)}
navItemsRight={config.navigationRight}
navItemsRight={config.navigationRight(lang)}
client:only="react"
/>
<slot />
Expand Down

0 comments on commit b9d57fb

Please sign in to comment.