diff --git a/src/components/pages/StigmataSetPage.tsx b/src/components/pages/StigmataSetPage.tsx index 9b6be0ce..2932b447 100644 --- a/src/components/pages/StigmataSetPage.tsx +++ b/src/components/pages/StigmataSetPage.tsx @@ -6,8 +6,9 @@ import StigmataCard from '../../components/molecules/StigmataCard' import Breadcrumb from '../../components/organisms/Breadcrumb' import Honkai3rdNavigator from '../../components/organisms/Honkai3rdNavigator' import { StigmataData, StigmataSet } from '../../lib/honkai3rd/stigmata' -import { capitalize } from '../../lib/string' import SecondaryLabel from '../atoms/SecondaryLabel' +import { translate, useTranslation } from '../../lib/i18n' +import { useRouter } from 'next/router' export interface StigmataSetProps { type: 'set' @@ -19,6 +20,20 @@ const StigmataSetPage = ({ stigmataSet, stigmataSetList, }: StigmataSetProps) => { + const { t } = useTranslation() + const { locale } = useRouter() + + const stigmataSetName = translate( + locale, + { 'ko-KR': stigmataSet.krName }, + stigmataSet.name + ) + const stigmataSetAltName = translate( + locale, + { 'ko-KR': stigmataSet.krAltName }, + stigmataSet.altName + ) + return ( @@ -26,26 +41,26 @@ const StigmataSetPage = ({ - {stigmataSet.name} + {stigmataSetName} - {stigmataSet.altName} + {stigmataSetAltName} @@ -67,6 +82,16 @@ const StigmataSetPage = ({ })} {stigmataSetList.map((stigmataSetItem) => { + const stigmataName = translate( + locale, + { 'ko-KR': stigmataSetItem.krName }, + stigmataSetItem.name + ) + const stigmataSkillDescrpition = translate( + locale, + { 'ko-KR': stigmataSetItem.skill.krDescription }, + stigmataSetItem.skill.description + ) return ( @@ -74,11 +99,11 @@ const StigmataSetPage = ({ - {stigmataSetItem.name} + {stigmataName} - {capitalize(stigmataSetItem.type)} + {t(`stigmata-show.${stigmataSetItem.type}`)} @@ -93,7 +118,7 @@ const StigmataSetPage = ({ '&:last-child': { borderBottom: 'none' }, }} > - {stigmataSetItem.skill.description} + {stigmataSkillDescrpition} ) @@ -102,16 +127,34 @@ const StigmataSetPage = ({ - {stigmataSet.twoSetSkill.name} + {translate( + locale, + { 'ko-KR': stigmataSet.twoSetSkill.krName }, + stigmataSet.twoSetSkill.name + )} - {stigmataSet.twoSetSkill.description} + {translate( + locale, + { 'ko-KR': stigmataSet.twoSetSkill.krDescription }, + stigmataSet.twoSetSkill.description + )} - {stigmataSet.threeSetSkill.name} + {translate( + locale, + { + 'ko-KR': stigmataSet.threeSetSkill.krName, + }, + stigmataSet.threeSetSkill.name + )} - {stigmataSet.threeSetSkill.description} + {translate( + locale, + { 'ko-KR': stigmataSet.threeSetSkill.krDescription }, + stigmataSet.threeSetSkill.description + )}