diff --git a/public/data/honkai3rd/versions/5.3/version-data.json b/public/data/honkai3rd/versions/5.3/version-data.json index 8bfd514a..43c4d2d9 100644 --- a/public/data/honkai3rd/versions/5.3/version-data.json +++ b/public/data/honkai3rd/versions/5.3/version-data.json @@ -2,6 +2,7 @@ "version": "5.3", "nextVersion": "5.4", "name": "Post Dusk Odyssey", + "krName": "황혼후서", "duration": ["2021-12-02", "2022-01-13"], "newBattlesuits": ["sns"], "newWeapons": ["hekate-s-sombre", "miracle-kissy-pillow"], diff --git a/public/data/honkai3rd/versions/5.4/version-data.json b/public/data/honkai3rd/versions/5.4/version-data.json index a5bdcc61..74ca2a96 100644 --- a/public/data/honkai3rd/versions/5.4/version-data.json +++ b/public/data/honkai3rd/versions/5.4/version-data.json @@ -2,6 +2,7 @@ "version": "5.4", "previousVersion": "5.3", "name": "Silverwing Beyond", + "krName": "피안의 은익", "duration": ["2022-01-13"], "newBattlesuits": ["sw"], "newWeapons": ["falcon-flare-0019", "falcon-flare-final"], diff --git a/public/locales/en-US/common.json b/public/locales/en-US/common.json index ced61f86..681491b3 100644 --- a/public/locales/en-US/common.json +++ b/public/locales/en-US/common.json @@ -12,7 +12,8 @@ "battlesuits": "Battlesuits", "stigmata": "Stigmata", "weapons": "Weapons", - "elfs": "ELFs" + "elfs": "ELFs", + "versions": "Versions" }, "battlesuits-list": { "heading": "Battlesuits", @@ -60,5 +61,15 @@ "basic": "Basic", "ultimate": "Ultimate", "team": "Team" + }, + "versions": { + "all-versions": "All Versions", + "previous": "Previous Version", + "next": "Next Version", + "current": "Current Version", + "new-battlesuits": "New Battlesuits", + "new-weapons": "New Weapons", + "supply-events": "Supply Events", + "supply-events-disclaimer": "DISCLAIMER: The schedule is based on Global - Americas Server. It may not be accurate since we update this manually. Please check the actual in-game information again before pulling supplies." } } diff --git a/public/locales/ko-KR/common.json b/public/locales/ko-KR/common.json index 8c0d2064..1c1fa118 100644 --- a/public/locales/ko-KR/common.json +++ b/public/locales/ko-KR/common.json @@ -15,7 +15,8 @@ "mid": "(중)", "bot": "(하)", "weapons": "무기", - "elfs": "무장인형" + "elfs": "무장인형", + "versions": "업데이트" }, "battlesuits-list": { "heading": "발키리", @@ -63,5 +64,15 @@ "basic": "기본 공격", "ultimate": "필살기", "team": "팀" + }, + "versions": { + "all-versions": "모든 업데이트", + "previous": "이전 버전", + "next": "다음 버전", + "current": "현재 버전", + "new-battlesuits": "신규 발키리", + "new-weapons": "신규 무기", + "supply-events": "보급 이벤트", + "supply-events-disclaimer": "주의: 보급 일정은 글로벌 아메리카 서버 기준으로 작성되어 있습니다. 수작업으로 갱신하기에 정확하지 않은 부분이 있을 수도 있습니다. 보급 가차를 돌리기 전에 게임 내 정보를 꼭 다시 한번 확인해주세요." } } diff --git a/src/lib/honkai3rd/versions.ts b/src/lib/honkai3rd/versions.ts index e0132472..0007cf6b 100644 --- a/src/lib/honkai3rd/versions.ts +++ b/src/lib/honkai3rd/versions.ts @@ -3,6 +3,7 @@ export interface VersionData { previousVersion?: string nextVersion?: string name: string + krName?: string duration: [string, string] verified: boolean newBattlesuits: string[] diff --git a/src/pages/honkai3rd/versions/[versionId].tsx b/src/pages/honkai3rd/versions/[versionId].tsx index 5ba6732c..60a929fe 100644 --- a/src/pages/honkai3rd/versions/[versionId].tsx +++ b/src/pages/honkai3rd/versions/[versionId].tsx @@ -1,5 +1,5 @@ /** @jsxImportSource theme-ui */ -import { Box, Heading, Link, Flex, Text } from '@theme-ui/components' +import { Box, Heading, Link, Flex, Text, Paragraph } from '@theme-ui/components' import { NextPageContext } from 'next' import Breadcrumb from '../../../components/organisms/Breadcrumb' import GanttChart from '../../../components/organisms/GanttChart' @@ -21,6 +21,8 @@ import { WeaponData } from '../../../lib/honkai3rd/weapons' import { SupplyEventData } from '../../../lib/honkai3rd/supplyEvents' import { VersionData } from '../../../lib/honkai3rd/versions' import { generateI18NPaths, getI18NProps } from '../../../server/i18n' +import { translate, useTranslation } from '../../../lib/i18n' +import { useRouter } from 'next/router' interface VersionShowPageProps { versionData: VersionData @@ -35,6 +37,9 @@ const VersionShowPage = ({ weapons, supplyEvents, }: VersionShowPageProps) => { + const { t } = useTranslation() + const { locale } = useRouter() + return ( @@ -42,8 +47,8 @@ const VersionShowPage = ({ - Previous (v{versionData.previousVersion}) + + {t('versions.previous')} (v{versionData.previousVersion}) + )} {versionData.nextVersion != null && ( @@ -65,12 +72,19 @@ const VersionShowPage = ({ href={`/honkai3rd/versions/${versionData.nextVersion}`} passHref > - Next (v{versionData.nextVersion}) + + {t('versions.next')} (v{versionData.nextVersion}) + )} - v{versionData.version} : {versionData.name} + v{versionData.version} :{' '} + {translate( + locale, + { 'ko-KR': versionData.krName }, + versionData.name + )} {formatDate(new Date(versionData.duration[0]), 'PP')} -{' '} @@ -81,10 +95,16 @@ const VersionShowPage = ({ - New Battlesuits + {t('versions.new-battlesuits')} {battlesuits.map((battlesuit) => { + const battlesuitName = translate( + locale, + { 'ko-KR': battlesuit.krName }, + battlesuit.name + ) + return ( - {battlesuit.name} + {battlesuitName} @@ -108,10 +128,15 @@ const VersionShowPage = ({ - New Weapons + {t('versions.new-weapons')} {weapons.map((weapon) => { + const weaponName = translate( + locale, + { 'ko-KR': weapon.krName }, + weapon.name + ) return ( - {weapon.name} + {weaponName} @@ -136,9 +161,9 @@ const VersionShowPage = ({ - Supply Events + {t('versions.supply-events')} - + { @@ -177,6 +202,7 @@ const VersionShowPage = ({ /> + {t('versions.supply-events-disclaimer')} diff --git a/src/pages/honkai3rd/versions/index.tsx b/src/pages/honkai3rd/versions/index.tsx index bb5211d6..7bddd3fb 100644 --- a/src/pages/honkai3rd/versions/index.tsx +++ b/src/pages/honkai3rd/versions/index.tsx @@ -1,5 +1,5 @@ /** @jsxImportSource theme-ui */ -import { Box, Flex, Heading, Link, Text } from '@theme-ui/components' +import { Box, Flex, Heading, Link, Text, Paragraph } from '@theme-ui/components' import NextLink from 'next/link' import SquareImageBox from '../../../components/atoms/SquareImageBox' import Breadcrumb from '../../../components/organisms/Breadcrumb' @@ -21,6 +21,8 @@ import { VersionData } from '../../../lib/honkai3rd/versions' import { SupplyEventData } from '../../../lib/honkai3rd/supplyEvents' import { getI18NProps } from '../../../server/i18n' import { NextPageContext } from 'next' +import { useTranslation, translate } from '../../../lib/i18n' +import { useRouter } from 'next/router' interface VersionIndexPageProps { versionDataList: VersionData[] @@ -37,6 +39,9 @@ const VersionIndexPage = ({ currentVersionNewWeapons, currentVersionSupplyEvents, }: VersionIndexPageProps) => { + const { t } = useTranslation() + const { locale } = useRouter() + return ( @@ -55,7 +60,10 @@ const VersionIndexPage = ({ href={`/honkai3rd/versions/${currentVersionData.previousVersion}`} passHref > - Previous (v{currentVersionData.previousVersion}) + + {t('versions.previous')} (v + {currentVersionData.previousVersion}) + )} {currentVersionData.nextVersion != null && ( @@ -63,14 +71,21 @@ const VersionIndexPage = ({ href={`/honkai3rd/versions/${currentVersionData.nextVersion}`} passHref > - Next (v{currentVersionData.nextVersion}) + + {t('versions.next')} (v{currentVersionData.nextVersion}) + )} - v{currentVersionData.version} : {currentVersionData.name}{' '} - (Current Version) + v{currentVersionData.version} :{' '} + {translate( + locale, + { 'ko-KR': currentVersionData.krName }, + currentVersionData.name + )}{' '} + ({t('versions.current')}) {formatDate(new Date(currentVersionData.duration[0]), 'PP')} -{' '} @@ -81,10 +96,16 @@ const VersionIndexPage = ({ - New Battlesuits + {t('versions.new-battlesuits')} {currentVersionNewBattlesuits.map((battlesuit) => { + const battlesuitName = translate( + locale, + { 'ko-KR': battlesuit.krName }, + battlesuit.name + ) + return ( - {battlesuit.name} + {battlesuitName} @@ -108,10 +129,15 @@ const VersionIndexPage = ({ - New Weapons + {t('versions.new-weapons')} {currentVersionNewWeapons.map((weapon) => { + const weaponName = translate( + locale, + { 'ko-KR': weapon.krName }, + weapon.name + ) return ( - {weapon.name} + {weaponName} @@ -136,9 +162,9 @@ const VersionIndexPage = ({ - Supply Events + {t('versions.supply-events')} - + { @@ -177,18 +203,11 @@ const VersionIndexPage = ({ /> - - - Learn more... - - + {t('versions.supply-events-disclaimer')} - All Versions + {t('versions.all-versions')} {versionDataList.map((versionData) => { @@ -200,8 +219,13 @@ const VersionIndexPage = ({ passHref > - {versionData.version} : {versionData.name} ( - {formatDate(new Date(versionData.duration[0]), 'PP')} -{' '} + {versionData.version} : + {translate( + locale, + { 'ko-KR': versionData.krName }, + versionData.name + )}{' '} + ({formatDate(new Date(versionData.duration[0]), 'PP')} -{' '} {versionData.duration[1] != null ? formatDate(new Date(versionData.duration[1]), 'PP') : ''}