Translate battlesuit show page
This commit is contained in:
@@ -15,5 +15,14 @@
|
|||||||
"heading": "Battlesuits",
|
"heading": "Battlesuits",
|
||||||
"filter-by-features": "Filter by Features",
|
"filter-by-features": "Filter by Features",
|
||||||
"filter-by-valkyries": "Filter by Valkyries"
|
"filter-by-valkyries": "Filter by Valkyries"
|
||||||
|
},
|
||||||
|
"battlesuit-show": {
|
||||||
|
"leader": "Leader",
|
||||||
|
"passive": "Passive",
|
||||||
|
"evasion": "Evasion",
|
||||||
|
"special-attack": "Special Attack",
|
||||||
|
"ultimate": "Ultimate",
|
||||||
|
"basic-attack": "Basic Attack",
|
||||||
|
"sp-skill": "SP Skill"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,5 +15,14 @@
|
|||||||
"heading": "발키리",
|
"heading": "발키리",
|
||||||
"filter-by-features": "특성 필터",
|
"filter-by-features": "특성 필터",
|
||||||
"filter-by-valkyries": "발키리 필터"
|
"filter-by-valkyries": "발키리 필터"
|
||||||
|
},
|
||||||
|
"battlesuit-show": {
|
||||||
|
"leader": "리더 스킬",
|
||||||
|
"passive": "패시브 스킬",
|
||||||
|
"evasion": "회피",
|
||||||
|
"special-attack": "특수 공격",
|
||||||
|
"ultimate": "필살기",
|
||||||
|
"basic-attack": "기본 공격",
|
||||||
|
"sp-skill": "SP 스킬"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
export interface BattlesuitSkill {
|
export interface BattlesuitSkill {
|
||||||
name: string
|
name: string
|
||||||
|
krName?: string
|
||||||
description: string
|
description: string
|
||||||
requiredRank: string
|
krDescription: string
|
||||||
|
requiredRank?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BattlesuitSkillGroup {
|
export interface BattlesuitSkillGroup {
|
||||||
core: BattlesuitSkill
|
core: BattlesuitSkill
|
||||||
subskills: BattlesuitSkill[]
|
subskills: BattlesuitSkill[]
|
||||||
@@ -12,6 +15,7 @@ export interface BattlesuitData {
|
|||||||
id: string
|
id: string
|
||||||
version?: string
|
version?: string
|
||||||
name: string
|
name: string
|
||||||
|
krName?: string
|
||||||
type: string
|
type: string
|
||||||
valkyrie: string
|
valkyrie: string
|
||||||
features: string[]
|
features: string[]
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import {
|
|||||||
getBattlesuitById,
|
getBattlesuitById,
|
||||||
listBattlesuits,
|
listBattlesuits,
|
||||||
} from '../../../server/data/honkai3rd/battlesuits'
|
} from '../../../server/data/honkai3rd/battlesuits'
|
||||||
import { useTranslation } from '../../../lib/i18n'
|
import { translate, useTranslation } from '../../../lib/i18n'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
|
||||||
interface BattlesuitShowPageProps {
|
interface BattlesuitShowPageProps {
|
||||||
battlesuit: BattlesuitData
|
battlesuit: BattlesuitData
|
||||||
@@ -28,6 +29,14 @@ interface BattlesuitShowPageProps {
|
|||||||
|
|
||||||
const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const { locale } = useRouter()
|
||||||
|
|
||||||
|
const battlesuitName = translate(
|
||||||
|
locale,
|
||||||
|
{ ['ko-KR']: battlesuit.krName },
|
||||||
|
battlesuit.name
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Honkai3rdNavigator />
|
<Honkai3rdNavigator />
|
||||||
@@ -42,12 +51,12 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: `/honkai3rd/battlesuits/${battlesuit.id}`,
|
href: `/honkai3rd/battlesuits/${battlesuit.id}`,
|
||||||
label: battlesuit.name,
|
label: battlesuitName,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Heading as='h1'>{battlesuit.name}</Heading>
|
<Heading as='h1'>{battlesuitName}</Heading>
|
||||||
|
|
||||||
<Box mb={3}>
|
<Box mb={3}>
|
||||||
<Box
|
<Box
|
||||||
@@ -59,7 +68,7 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
alt={battlesuit.name}
|
alt={battlesuitName}
|
||||||
src={`/assets/honkai3rd/battlesuits/${battlesuit.id}.png`}
|
src={`/assets/honkai3rd/battlesuits/${battlesuit.id}.png`}
|
||||||
width={600}
|
width={600}
|
||||||
height={600}
|
height={600}
|
||||||
@@ -113,38 +122,38 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<BattlesuitSkillGroupCard
|
<BattlesuitSkillGroupCard
|
||||||
heading='Leader'
|
heading={t('battlesuit-show.leader')}
|
||||||
skillGroup={battlesuit.leader}
|
skillGroup={battlesuit.leader}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BattlesuitSkillGroupCard
|
<BattlesuitSkillGroupCard
|
||||||
heading='Passive'
|
heading={t('battlesuit-show.passive')}
|
||||||
skillGroup={battlesuit.passive}
|
skillGroup={battlesuit.passive}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BattlesuitSkillGroupCard
|
<BattlesuitSkillGroupCard
|
||||||
heading='Evasion'
|
heading={t('battlesuit-show.evasion')}
|
||||||
skillGroup={battlesuit.evasion}
|
skillGroup={battlesuit.evasion}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BattlesuitSkillGroupCard
|
<BattlesuitSkillGroupCard
|
||||||
heading='Special Attack'
|
heading={t('battlesuit-show.special-attack')}
|
||||||
skillGroup={battlesuit.special}
|
skillGroup={battlesuit.special}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BattlesuitSkillGroupCard
|
<BattlesuitSkillGroupCard
|
||||||
heading='Ultimate'
|
heading={t('battlesuit-show.ultimate')}
|
||||||
skillGroup={battlesuit.ultimate}
|
skillGroup={battlesuit.ultimate}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BattlesuitSkillGroupCard
|
<BattlesuitSkillGroupCard
|
||||||
heading='Basic Attack'
|
heading={t('battlesuit-show.basic-attack')}
|
||||||
skillGroup={battlesuit.basic}
|
skillGroup={battlesuit.basic}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{battlesuit.sp != null && (
|
{battlesuit.sp != null && (
|
||||||
<BattlesuitSkillGroupCard
|
<BattlesuitSkillGroupCard
|
||||||
heading='SP Skill'
|
heading={t('battlesuit-show.sp-skill')}
|
||||||
skillGroup={battlesuit.sp}
|
skillGroup={battlesuit.sp}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { translate, useTranslation } from '../../../lib/i18n'
|
|||||||
|
|
||||||
type BattlesuitListItemData = Pick<
|
type BattlesuitListItemData = Pick<
|
||||||
BattlesuitData,
|
BattlesuitData,
|
||||||
'id' | 'name' | 'features' | 'type' | 'valkyrie'
|
'id' | 'name' | 'krName' | 'features' | 'type' | 'valkyrie'
|
||||||
>
|
>
|
||||||
|
|
||||||
interface BattlesuitListPageProps {
|
interface BattlesuitListPageProps {
|
||||||
@@ -140,7 +140,10 @@ export async function getStaticProps({ locale }: NextPageContext) {
|
|||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
battlesuits: listBattlesuits().map((battlesuit) =>
|
battlesuits: listBattlesuits().map((battlesuit) =>
|
||||||
pick(['id', 'name', 'features', 'type', 'valkyrie'], battlesuit)
|
pick(
|
||||||
|
['id', 'name', 'krName', 'features', 'type', 'valkyrie'],
|
||||||
|
battlesuit
|
||||||
|
)
|
||||||
),
|
),
|
||||||
...(await getI18NProps(locale)),
|
...(await getI18NProps(locale)),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user