Refactor locale

This commit is contained in:
Sakura Knoll
2022-04-05 07:36:08 +09:00 Unverified
parent 08fad17e96
commit df0b073d65
16 changed files with 107 additions and 94 deletions
+12 -9
View File
@@ -1,21 +1,15 @@
{
"nav": {
"common": {
"abyss-lab": "Abyss Lab",
"honkai-3rd": "Honkai 3rd",
"versions": "Versions",
"battlesuits": "Battlesuits",
"weapons": "Weapons",
"stigmata": "Stigmata",
"elfs": "ELFs"
},
"breadcrumb": {
"honkai-3rd": "Honkai 3rd",
"battlesuits": "Battlesuits",
"stigmata": "Stigmata",
"weapons": "Weapons",
"elfs": "ELFs",
"versions": "Versions"
"elysian-realm": "Elysian Realm (WIP)"
},
"nav": {},
"index": {
"honkai-3rd": "Honkai 3rd",
"battlesuits": "Battlesuits",
@@ -127,5 +121,14 @@
"label": "Divine Key Supply",
"description": "Only available in special supply events like Firepower Supply and Schicksal Arsenal. Pull with 280 x crystal for each supply."
}
},
"elysian-realm": {
"signets": "Signets",
"remembrance-sigil": "Remembrance Sigil",
"supports": "Supports",
"no-upgrades": "No Upgrades Available",
"nexus-signets": "Nexus Signets",
"normal-signets": "Normal Signets",
"exclusive-signets": "Exclusive Signets"
}
}
+12 -14
View File
@@ -1,25 +1,14 @@
{
"nav": {
"common": {
"elysian-realm": "과거의 낙원 (작업중)",
"battlesuits": "발키리",
"abyss-lab": "어비스랩",
"honkai-3rd": "붕괴 3rd",
"versions": "업데이트",
"battlesuits": "발키리",
"weapons": "무기",
"stigmata": "성흔",
"elfs": "인형"
},
"breadcrumb": {
"honkai-3rd": "붕괴 3rd",
"battlesuits": "발키리",
"stigmata": "성흔",
"top": "(상)",
"mid": "(중)",
"bot": "(하)",
"weapons": "무기",
"elfs": "인형",
"versions": "업데이트",
"description": "비공식 붕괴 3rd 위키"
},
"battlesuits-list": {
"heading": "발키리",
"description": "붕괴 3rd 발키리 목록",
@@ -126,5 +115,14 @@
"label": "신의 열쇠 보급",
"description": "천명 무기고나 화력 보급등 특수 보급 이벤트에서만 획득 가능. 보급마다 280 x 수정을 소모."
}
},
"elysian-realm": {
"signets": "각인",
"remembrance-sigil": "회상의 증명",
"supports": "지원 발키리",
"no-upgrades": "레벨업 불가능",
"nexus-signets": "증폭 각인",
"normal-signets": "일반 각인",
"exclusive-signets": "전용 각인"
}
}
+13 -6
View File
@@ -11,9 +11,15 @@ interface BattlesuitCardProps {
battlesuit: Pick<BattlesuitData, 'id' | 'name' | 'krName'>
hidden?: boolean
size?: 'sm' | 'default'
href?: string
}
const BattlesuitCard = ({ battlesuit, hidden, size }: BattlesuitCardProps) => {
const BattlesuitCard = ({
battlesuit,
hidden,
size,
href,
}: BattlesuitCardProps) => {
const { locale } = useRouter()
const battlesuitName = translate(
@@ -22,6 +28,10 @@ const BattlesuitCard = ({ battlesuit, hidden, size }: BattlesuitCardProps) => {
battlesuit.name
)
if (href == null) {
href = `/honkai3rd/battlesuits/${battlesuit.id}`
}
if (size === 'sm') {
return (
<Card
@@ -35,7 +45,7 @@ const BattlesuitCard = ({ battlesuit, hidden, size }: BattlesuitCardProps) => {
},
}}
>
<PageLink href={`/honkai3rd/battlesuits/${battlesuit.id}`}>
<PageLink href={href}>
<Flex>
<SquareImageBox
mr={2}
@@ -72,10 +82,7 @@ const BattlesuitCard = ({ battlesuit, hidden, size }: BattlesuitCardProps) => {
},
}}
>
<PageLink
href={`/honkai3rd/battlesuits/${battlesuit.id}`}
key={battlesuit.id}
>
<PageLink href={href}>
<SquareImageBox
alt={battlesuitName}
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
+5 -7
View File
@@ -50,12 +50,10 @@ const SingleStigmataPage = ({
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${stigmataName} - ${t(
'nav.abyss-lab'
title={`${t('common.honkai-3rd')}: ${stigmataName} - ${t(
'common.abyss-lab'
)}`}
description={`${t('breadcrumb.honkai-3rd')} ${t(
'stigmata-show.stigmata'
)} /
description={`${t('common.honkai-3rd')} ${t('stigmata-show.stigmata')} /
${'⭐'.repeat(stigmataData.rarity)} / ${t(
`stigmata-show.${stigmataData.type}`
)} / HP : ${stigmataData.hp} / ATK : ${stigmataData.atk} / DEF : ${
@@ -65,8 +63,8 @@ const SingleStigmataPage = ({
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd/stigmata', label: t('breadcrumb.stigmata') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{ href: '/honkai3rd/stigmata', label: t('common.stigmata') },
{
href: `/honkai3rd/stigmata/${stigmataData.id}`,
label: stigmataName,
+5 -5
View File
@@ -38,10 +38,10 @@ const StigmataSetPage = ({
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${stigmataSetName} ${t(
title={`${t('common.honkai-3rd')}: ${stigmataSetName} ${t(
'stigmata-show.stigmata-set'
)} - ${t('nav.abyss-lab')}`}
description={`${t('breadcrumb.honkai-3rd')} ${t(
)} - ${t('common.abyss-lab')}`}
description={`${t('common.honkai-3rd')} ${t(
'stigmata-show.stigmata-set'
)} / ${'⭐'.repeat(stigmataSet.rarity)} / ${stigmataSetAltName}`}
/>
@@ -49,13 +49,13 @@ const StigmataSetPage = ({
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{
href: {
pathname: `/honkai3rd/stigmata`,
query: { list: 'set' },
},
label: t('breadcrumb.stigmata'),
label: t('common.stigmata'),
},
{
href: `/honkai3rd/stigmata/${stigmataSet.id}-set`,
@@ -85,10 +85,10 @@ const BattlesuitShowPage = ({
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${battlesuitName} - ${t(
'nav.abyss-lab'
title={`${t('common.honkai-3rd')}: ${battlesuitName} - ${t(
'common.abyss-lab'
)}`}
description={`${t('breadcrumb.honkai-3rd')} ${t(
description={`${t('common.honkai-3rd')} ${t(
'battlesuit-show.battlesuit'
)} / ${valkyrieName} / ${battlesuitTypeLabel} / ${battlesuit.features
.map((feature) => {
@@ -109,10 +109,10 @@ const BattlesuitShowPage = ({
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{
href: '/honkai3rd/battlesuits',
label: t('breadcrumb.battlesuits'),
label: t('common.battlesuits'),
},
{
href: `/honkai3rd/battlesuits/${battlesuit.id}`,
+5 -5
View File
@@ -79,19 +79,19 @@ const BattlesuitListPage = ({ battlesuits }: BattlesuitListPageProps) => {
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${t(
'breadcrumb.battlesuits'
)} - ${t('nav.abyss-lab')}`}
title={`${t('common.honkai-3rd')}: ${t('common.battlesuits')} - ${t(
'common.abyss-lab'
)}`}
description={t('battlesuits-list.description')}
/>
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{
href: '/honkai3rd/battlesuits',
label: t('breadcrumb.battlesuits'),
label: t('common.battlesuits'),
},
]}
/>
+5 -5
View File
@@ -35,10 +35,10 @@ const ElfShowPage = ({ elf }: ElfShowPageProps) => {
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${elfName} - ${t(
'nav.abyss-lab'
title={`${t('common.honkai-3rd')}: ${elfName} - ${t(
'common.abyss-lab'
)}`}
description={`${t('breadcrumb.honkai-3rd')} ${t(
description={`${t('common.honkai-3rd')} ${t(
'elfs-show.elf'
)} / ${'⭐'.repeat(elf.baseRank)} / ${elf.features
.map((feature) => {
@@ -59,8 +59,8 @@ const ElfShowPage = ({ elf }: ElfShowPageProps) => {
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd/elfs', label: t('breadcrumb.elfs') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{ href: '/honkai3rd/elfs', label: t('common.elfs') },
{
href: `/honkai3rd/elfs/${elf.id}`,
label: elfName,
+4 -4
View File
@@ -21,16 +21,16 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${t('breadcrumb.elfs')} - ${t(
'nav.abyss-lab'
title={`${t('common.honkai-3rd')}: ${t('common.elfs')} - ${t(
'common.abyss-lab'
)}`}
description={t('elfs-list.description')}
/>
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd/elfs', label: t('breadcrumb.elfs') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{ href: '/honkai3rd/elfs', label: t('common.elfs') },
]}
/>
+2 -2
View File
@@ -112,13 +112,13 @@ const Honkai3rdIndexPage = () => {
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: Home - ${t('nav.abyss-lab')}`}
title={`${t('common.honkai-3rd')}: Home - ${t('common.abyss-lab')}`}
description={t('index.description')}
/>
<Box p={3}>
<Breadcrumb
items={[{ href: 'honkai3rd', label: t('breadcrumb.honkai-3rd') }]}
items={[{ href: 'honkai3rd', label: t('common.honkai-3rd') }]}
/>
<Heading as='h1'>Enemies </Heading>
</Box>
+12 -5
View File
@@ -46,15 +46,15 @@ const Honkai3rdIndexPage = () => {
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: Home - ${t('nav.abyss-lab')}`}
title={`${t('common.honkai-3rd')}: Home - ${t('common.abyss-lab')}`}
description={t('index.description')}
/>
<Box p={3}>
<Breadcrumb
items={[{ href: 'honkai3rd', label: t('breadcrumb.honkai-3rd') }]}
items={[{ href: 'honkai3rd', label: t('common.honkai-3rd') }]}
/>
<Heading as='h1'>{t('nav.honkai-3rd')} </Heading>
<Heading as='h1'>{t('common.honkai-3rd')} </Heading>
<Box
sx={{ position: 'relative', mb: 3, width: 280, height: 280 }}
@@ -75,6 +75,7 @@ const Honkai3rdIndexPage = () => {
<NavItem target='weapons' />
<NavItem target='stigmata' />
<NavItem target='elfs' />
<NavItem target='elysian-realm' />
</Box>
<Box>
@@ -106,7 +107,13 @@ export async function getStaticProps({ locale }: NextPageContext) {
export default Honkai3rdIndexPage
interface NavItemProps {
target: 'versions' | 'battlesuits' | 'stigmata' | 'weapons' | 'elfs'
target:
| 'versions'
| 'battlesuits'
| 'stigmata'
| 'weapons'
| 'elfs'
| 'elysian-realm'
}
const NavItem = ({ target }: NavItemProps) => {
@@ -121,7 +128,7 @@ const NavItem = ({ target }: NavItemProps) => {
mr={1}
src={`${assetsBucketBaseUrl}/honkai3rd/nav-icons/${target}.png`}
/>
<Text sx={{ fontSize: 3 }}>{t(`nav.${target}`)}</Text>
<Text sx={{ fontSize: 3 }}>{t(`common.${target}`)}</Text>
</Flex>
</Box>
</PageLink>
+5 -5
View File
@@ -40,17 +40,17 @@ const StigmataListPage = ({
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${t(
'breadcrumb.stigmata'
)} - ${t('nav.abyss-lab')}`}
title={`${t('common.honkai-3rd')}: ${t('common.stigmata')} - ${t(
'common.abyss-lab'
)}`}
description={t('stigmata-list.description')}
/>
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd/stigmata', label: t('breadcrumb.stigmata') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{ href: '/honkai3rd/stigmata', label: t('common.stigmata') },
]}
/>
+7 -7
View File
@@ -46,12 +46,12 @@ const VersionShowPage = ({
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: v${versionData.version} - ${t(
'nav.abyss-lab'
title={`${t('common.honkai-3rd')}: v${versionData.version} - ${t(
'common.abyss-lab'
)}`}
description={`${t('breadcrumb.honkai-3rd')} ${t(
'versions.version'
)} / ${t('versions.new-battlesuits')}: ${battlesuits
description={`${t('common.honkai-3rd')} ${t('versions.version')} / ${t(
'versions.new-battlesuits'
)}: ${battlesuits
.map((battlesuit) => {
return translate(
locale,
@@ -69,8 +69,8 @@ const VersionShowPage = ({
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd/versions', label: t('breadcrumb.versions') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{ href: '/honkai3rd/versions', label: t('common.versions') },
{
href: `/honkai3rd/versions/${versionData.version}`,
label: versionData.version,
+5 -5
View File
@@ -48,17 +48,17 @@ const VersionIndexPage = ({
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${t(
'breadcrumb.versions'
)} - ${t('nav.abyss-lab')}`}
title={`${t('common.honkai-3rd')}: ${t('common.versions')} - ${t(
'common.abyss-lab'
)}`}
description={t('versions.list-page-description')}
/>
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd/versions', label: t('breadcrumb.versions') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{ href: '/honkai3rd/versions', label: t('common.versions') },
]}
/>
<Box mb={4}>
+5 -5
View File
@@ -42,10 +42,10 @@ const WeaponShowPage = ({
return (
<Honkai3rdLayout>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${weaponName} - ${t(
'nav.abyss-lab'
title={`${t('common.honkai-3rd')}: ${weaponName} - ${t(
'common.abyss-lab'
)}`}
description={`${t('breadcrumb.honkai-3rd')} ${t(
description={`${t('common.honkai-3rd')} ${t(
'weapons-show.weapon'
)} / ${'⭐'.repeat(weapon.rarity)} / ${weaponCategory} / ATK : ${
weapon.atk
@@ -55,8 +55,8 @@ const WeaponShowPage = ({
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd/weapons', label: t('breadcrumb.weapons') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{ href: '/honkai3rd/weapons', label: t('common.weapons') },
{
href: `/honkai3rd/weapons/${weapon.id}`,
label: weaponName,
+5 -5
View File
@@ -60,17 +60,17 @@ const WeaponListPage = ({ weaponDataList }: WeaponListPageProps) => {
<Honkai3rdLayout>
<Box>
<Head
title={`${t('breadcrumb.honkai-3rd')}: ${t(
'breadcrumb.weapons'
)} - ${t('nav.abyss-lab')}`}
title={`${t('common.honkai-3rd')}: ${t('common.weapons')} - ${t(
'common.abyss-lab'
)}`}
description={t('weapons-list.description')}
/>
<Box p={3}>
<Breadcrumb
items={[
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
{ href: '/honkai3rd/weapons', label: t('breadcrumb.weapons') },
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
{ href: '/honkai3rd/weapons', label: t('common.weapons') },
]}
/>