Fix all locales

This commit is contained in:
Sakura Knoll
2023-07-15 13:52:33 +09:00 Unverified
parent 5cb208b9a0
commit 730dcfac22
26 changed files with 340 additions and 281 deletions
@@ -26,6 +26,7 @@ import Honkai3rdLayout from '../../../components/layouts/Honkai3rdLayout'
import { generateI18NPaths, getI18NProps } from '../../../server/i18n'
import Head from '../../../components/atoms/Head'
import { useTranslation } from 'next-i18next'
import { useLocale } from '../../../lib/i18n'
interface BattlesuitShowPageProps {
battlesuit: Battlesuit
@@ -33,6 +34,8 @@ interface BattlesuitShowPageProps {
const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
const { t } = useTranslation()
const locale = useLocale()
return (
<Honkai3rdLayout>
<Head
@@ -41,7 +44,7 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
battlesuit.attributeType
} / ${battlesuit.tags
.map(tag => {
return getTagTypeLabel(tag)
return getTagTypeLabel(tag, locale)
})
.join(', ')}`}
canonicalHref={`/honkai3rd/battlesuits/${battlesuit.id}`}
@@ -65,16 +68,16 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
<ChibiIcon id={battlesuit.character} />
<Box ml={1} mr={2}>
{getCharacterTypeLabel(battlesuit.character)}
{getCharacterTypeLabel(battlesuit.character, locale)}
</Box>
<AttributeIcon attributeType={battlesuit.attributeType} size={30} />
<Box ml={1} mr={2}>
{getAttributeLabel(battlesuit.attributeType)}
{getAttributeLabel(battlesuit.attributeType, locale)}
</Box>
<WeaponTypeIcon type={battlesuit.weapon} />
<Box ml={1}>{getWeaponTypeLabel(battlesuit.weapon)}</Box>
<Box ml={1}>{getWeaponTypeLabel(battlesuit.weapon, locale)}</Box>
</Flex>
</Flex>
<Flex sx={{ p: 1 }}>
@@ -82,7 +85,7 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
return (
<Flex key={tag} sx={{ mr: 2, alignItems: 'center' }}>
<TagIcon type={tag} />
<Box ml={1}>{getTagTypeLabel(tag)}</Box>
<Box ml={1}>{getTagTypeLabel(tag, locale)}</Box>
</Flex>
)
})}
@@ -108,7 +111,7 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
)}
</Flex>
<Box>{getSkillTypeLabel(skill.skillType)}</Box>
<Box>{getSkillTypeLabel(skill.skillType, locale)}</Box>
</Box>
<Box sx={{ whiteSpace: 'pre-wrap', borderBottom: 'default', p: 1 }}>
<FormattedText>{formatSkillInfo(skill)}</FormattedText>
+69 -19
View File
@@ -1,7 +1,7 @@
/** @jsxImportSource theme-ui */
import { Box, Heading } from '@theme-ui/components'
import { NextPageContext } from 'next'
import { Flex, Link, Text } from 'theme-ui'
import { Flex, Text } from 'theme-ui'
import { loadBattlesuitCatalog } from '../../../lib/v2/server/loadData'
import { BattlesuitCatalogItem, TagType } from '../../../lib/v2/data/types'
import BattlesuitCatalogItemCard from '../../../components/v2/BattlesuitCatalogItemCard'
@@ -11,13 +11,15 @@ import { useTranslation } from 'next-i18next'
import Breadcrumb from '../../../components/organisms/Breadcrumb'
import { getI18NProps } from '../../../server/i18n'
import FilterButton from '../../../components/atoms/FilterButton'
import { translate } from '../../../lib/i18n'
import { characterFilterTypes } from '../../../lib/v2/data/utils'
import { useLocale } from '../../../lib/i18n'
import { attributeTypes, characterFilterTypes, tagFilterTypes } from '../../../lib/v2/data/utils'
import { useRouter } from 'next/router'
import { useMemo } from 'react'
import { getCharacterTypeLabel, getTagTypeLabel } from '../../../lib/v2/data/text'
import { getAttributeLabel, getCharacterTypeLabel, getTagTypeLabel } from '../../../lib/v2/data/text'
import ChibiIcon from '../../../components/v2/ChibiIcon'
import TagIcon from '../../../components/v2/TagIcon'
import AttributeIcon from '../../../components/v2/AttributeIcon'
import PageLink from '../../../components/atoms/PageLink'
interface BattlesuitListPageProps {
battlesuitCatalog: BattlesuitCatalogItem[]
@@ -25,7 +27,8 @@ interface BattlesuitListPageProps {
const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
const { t } = useTranslation()
const { locale, query } = useRouter()
const { query } = useRouter()
const locale = useLocale()
const valkyrieFilter = useMemo(() => {
if (query.valkyrie == null) {
@@ -49,16 +52,28 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
return true
}
return valkyrieFilter === battlesuit.character
switch (valkyrieFilter) {
case 'bio':
case 'psy':
case 'mech':
case 'qua':
case 'img':
return battlesuit.attributeType === valkyrieFilter
}
return battlesuit.character === valkyrieFilter
})
}, [battlesuitCatalog, valkyrieFilter])
const tagFilterTypes = useMemo(() => {
const tagFilterTypeOptions = useMemo(() => {
const tagSet = battlesuitsFilteredByValkyrie.reduce<Set<TagType>>((set, battlesuit) => {
battlesuit.tags.forEach(tag => set.add(tag))
return set
}, new Set())
return [...tagSet]
return [...tagSet].sort((a, b) => {
return tagFilterTypes.indexOf(a) - tagFilterTypes.indexOf(b)
})
}, [battlesuitsFilteredByValkyrie])
return (
@@ -83,26 +98,36 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
<Heading as="h3">{t('battlesuits-list.filter-by-valkyries')}</Heading>
<Flex mb={2} sx={{ flexWrap: 'wrap' }}>
{attributeTypes.map(type => {
const active = type === valkyrieFilter
return (
<FilterButton key={type} active={active} href={active ? `` : `?valkyrie=${type}`} m={1}>
<Flex sx={{ alignItems: 'center' }}>
<AttributeIcon attributeType={type} size={30} />
<Text ml={1}>{getAttributeLabel(type, locale)}</Text>
</Flex>
</FilterButton>
)
})}
{characterFilterTypes.map(type => {
const active = type === valkyrieFilter
return (
<FilterButton key={type} active={active} href={active ? `` : `?valkyrie=${type}`} m={1}>
<Flex sx={{ alignItems: 'center' }}>
<ChibiIcon id={type} />
<Text ml={1}>
{translate(locale, { 'ko-KR': getCharacterTypeLabel(type, 'ko-KR') }, getCharacterTypeLabel(type))}
</Text>
<Text ml={1}>{getCharacterTypeLabel(type, locale)}</Text>
</Flex>
</FilterButton>
)
})}
</Flex>
{tagFilterTypes.length > 0 && (
{tagFilterTypeOptions.length > 0 && (
<>
<Heading as="h3">{t('battlesuits-list.filter-by-features')}</Heading>
<Flex mb={2} sx={{ flexWrap: 'wrap' }}>
{tagFilterTypes.map(type => {
{tagFilterTypeOptions.map(type => {
const active = type === tagFilter
return (
<FilterButton
@@ -115,9 +140,7 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
>
<Flex sx={{ alignItems: 'center' }}>
<TagIcon type={type} />
<Text ml={1}>
{translate(locale, { 'ko-KR': getTagTypeLabel(type, 'ko-KR') }, getTagTypeLabel(type))}
</Text>
<Text ml={1}>{getTagTypeLabel(type, locale)}</Text>
</Flex>
</FilterButton>
)
@@ -134,12 +157,13 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
}
return battlesuit.tags.findIndex(tag => tag === tagFilter) > -1
})
.sort(sortBattlesuits)
.map(battlesuit => {
return (
<Box key={battlesuit.id}>
<Link href={`/honkai3rd/battlesuits/${battlesuit.id}`}>
<PageLink href={`/honkai3rd/battlesuits/${battlesuit.id}`}>
<BattlesuitCatalogItemCard battlesuit={battlesuit} />
</Link>
</PageLink>
</Box>
)
})}
@@ -152,9 +176,35 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
export default BattlesuitListPage
export async function getStaticProps({ locale }: NextPageContext) {
const battlesuitCatalog = loadBattlesuitCatalog()
const battlesuitCatalog = loadBattlesuitCatalog(locale).filter(item => {
// APHO 2
if (item.id.match(/90[0-9]{2}/)) {
return false
}
switch (item.id) {
// Durandal Story Only
case '805':
// Bronya Story Only?
case '316':
// APHO 1
case '1411':
case '1304':
case '1203':
return false
}
return true
})
return {
props: { battlesuitCatalog, ...(await getI18NProps(locale)) }
}
}
function sortBattlesuits(a: BattlesuitCatalogItem, b: BattlesuitCatalogItem) {
return getOrderIndex(b) - getOrderIndex(a)
function getOrderIndex(battlesuit: BattlesuitCatalogItem) {
return parseInt(battlesuit.id)
}
}
+1 -1
View File
@@ -128,7 +128,7 @@ const ElfShowPage = ({ elf }: ElfShowPageProps) => {
export default ElfShowPage
export async function getStaticProps({ locale, params }: NextPageContext & { params: { elfId: string } }) {
const elf = loadElfData(params.elfId)
const elf = loadElfData(params.elfId, locale)
return {
props: { elf, ...(await getI18NProps(locale)) }
+6 -5
View File
@@ -1,7 +1,7 @@
/** @jsxImportSource theme-ui */
import { Box, Card, Heading } from '@theme-ui/components'
import { NextPageContext } from 'next'
import { Flex, Link } from 'theme-ui'
import { Flex } from 'theme-ui'
import { ElfCatalogItem } from '../../../lib/v2/data/types'
import { loadElfCatalog } from '../../../lib/v2/server/loadData'
import RarityBar from '../../../components/v2/RarityBar'
@@ -11,6 +11,7 @@ import Head from '../../../components/atoms/Head'
import { useTranslation } from 'next-i18next'
import { getI18NProps } from '../../../server/i18n'
import Breadcrumb from '../../../components/organisms/Breadcrumb'
import PageLink from '../../../components/atoms/PageLink'
interface ElfListPageProps {
elfs: ElfCatalogItem[]
@@ -34,7 +35,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
{ href: '/honkai3rd/elfs', label: t('common.elfs') }
]}
/>
<Heading as="h1">Elfs</Heading>
<Heading as="h1">{t('elfs-list.elfs')}</Heading>
<Flex sx={{ flexWrap: 'wrap' }}>
{elfs
.sort((a, b) => {
@@ -49,7 +50,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
.map(elf => {
return (
<Box key={elf.id} m={2}>
<Link href={`/honkai3rd/elfs/${elf.id}`}>
<PageLink href={`/honkai3rd/elfs/${elf.id}`}>
<Card p={1}>
<Box>
<ElfIcon icon={elf.cardIcon} />
@@ -61,7 +62,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
{elf.fullName}
</Box>
</Card>
</Link>
</PageLink>
</Box>
)
})}
@@ -74,7 +75,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
export default ElfListPage
export async function getStaticProps({ locale }: NextPageContext) {
const elfs = loadElfCatalog()
const elfs = loadElfCatalog(locale)
return {
props: { elfs, ...(await getI18NProps(locale)) }
@@ -134,8 +134,8 @@ const BattlesuitShowPage = ({ battlesuit, erBattlesuit }: BattlesuitShowPageProp
export default BattlesuitShowPage
export async function getStaticProps({ locale, params }: NextPageContext & { params: { battlesuitId: string } }) {
const battlesuit = loadBattlesuitData(params.battlesuitId)
const erBattlesuit = loadErBattlesuit(params.battlesuitId)
const battlesuit = loadBattlesuitData(params.battlesuitId, locale)
const erBattlesuit = loadErBattlesuit(params.battlesuitId, locale)
return {
props: { battlesuit, erBattlesuit, ...(await getI18NProps(locale)) }
+13 -11
View File
@@ -21,6 +21,8 @@ import Breadcrumb from '../../../components/organisms/Breadcrumb'
import { useTranslation } from 'next-i18next'
import { getI18NProps } from '../../../server/i18n'
import PageLink from '../../../components/atoms/PageLink'
import { getSignetGroupLabel } from '../../../lib/v2/data/text'
import { useLocale } from '../../../lib/i18n'
interface ErPageProps {
erBattlesuitCatalog: ErBattlesuitCatalogItem[]
@@ -31,6 +33,7 @@ interface ErPageProps {
const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }: ErPageProps) => {
const { t } = useTranslation()
const locale = useLocale()
const battlesuitCatalogMap = useMemo(() => {
return battlesuitCatalog.reduce((map, item) => {
@@ -57,9 +60,9 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
}
]}
/>
<Heading as="h1">Elysian Realm</Heading>
<Heading as="h1">{t('elysian-realm.elysian-realm')}</Heading>
<Heading as="h2">Signets</Heading>
<Heading as="h2">{t('elysian-realm.signets')}</Heading>
<Flex sx={{ flexWrap: 'wrap', mb: 3 }}>
{signetGroups.map(signetGroup => {
return (
@@ -71,7 +74,7 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
originalSize={120}
size={40}
/>
<Box p={1}>{signetGroup.name}</Box>
<Box p={1}>{getSignetGroupLabel(signetGroup.id, locale)}</Box>
</Flex>
</Card>
</PageLink>
@@ -79,7 +82,7 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
})}
</Flex>
<Heading as="h2">Battlesuits</Heading>
<Heading as="h2">{t('elysian-realm.battlesuits')}</Heading>
<Flex sx={{ flexWrap: 'wrap', mb: 3 }}>
{erBattlesuitCatalog.map(erBattlesuit => {
const battlesuit = battlesuitCatalogMap.get(erBattlesuit.battlesuit)!
@@ -93,7 +96,7 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
})}
</Flex>
<Heading as="h2">Supports</Heading>
<Heading as="h2">{t('elysian-realm.supports')}</Heading>
<Flex sx={{ flexWrap: 'wrap' }}>
{erSupports.map(support => {
@@ -109,14 +112,13 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
{battlesuit.fullName}
</Box>
</Box>
{/* <BattlesuitCatalogItemCard battlesuit={battlesuit} /> */}
</PageLink>
</Box>
)
})}
</Flex>
<Heading as="h2">Sigils</Heading>
<Heading as="h2">{t('elysian-realm.remembrance-sigil')}</Heading>
<Flex sx={{ flexWrap: 'wrap' }}>
{erSigils.map(sigil => {
@@ -137,13 +139,13 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
export default ErPage
export async function getStaticProps({ locale }: NextPageContext) {
const erBattlesuitCatalog = loadErBattlesuitCatalog()
const battlesuitCatalog = loadBattlesuitCatalog()
const erSupports = loadErSupports().map(support => {
const erBattlesuitCatalog = loadErBattlesuitCatalog(locale)
const battlesuitCatalog = loadBattlesuitCatalog(locale)
const erSupports = loadErSupports(locale).map(support => {
return support.battlesuit
})
const erSigils = loadErSigils().map(sigil => {
const erSigils = loadErSigils(locale).map(sigil => {
return {
id: sigil.id,
name: sigil.name
+3 -3
View File
@@ -22,7 +22,7 @@ const SigilsPage = ({ erSigils }: SigilsPageProps) => {
title={`${t('elysian-realm.remembrance-sigil')} (${t('common.elysian-realm')}) - ${t(
'common.honkai-3rd'
)} - ${t('common.abyss-lab')}`}
description={`${t('common.elysian-realm')} ${t('elysian-realm.supports')}`}
description={`${t('common.elysian-realm')} ${t('elysian-realm.remembrance-sigil')}`}
canonicalHref={`/honkai3rd/er/sigils`}
/>
@@ -41,7 +41,7 @@ const SigilsPage = ({ erSigils }: SigilsPageProps) => {
]}
/>
<Heading as="h1">ER Sigils</Heading>
<Heading as="h1">{t('elysian-realm.remembrance-sigil')}</Heading>
<Card mb={3}>
{erSigils.map(sigil => {
@@ -76,7 +76,7 @@ const SigilsPage = ({ erSigils }: SigilsPageProps) => {
export default SigilsPage
export async function getStaticProps({ locale }: NextPageContext) {
const erSigils = loadErSigils()
const erSigils = loadErSigils(locale)
return {
props: { erSigils, ...(await getI18NProps(locale)) }
+6 -4
View File
@@ -6,12 +6,13 @@ import { Fragment, useMemo } from 'react'
import { assetsBucketBaseUrl } from '../../../../lib/consts'
import { signetGroups } from '../../../../lib/v2/data/er'
import SquareImage from '../../../../components/v2/SquareImage'
import { getErSignetTypeLabel } from '../../../../lib/v2/data/text'
import { getErSignetTypeLabel, getSignetGroupLabel } from '../../../../lib/v2/data/text'
import Honkai3rdLayout from '../../../../components/layouts/Honkai3rdLayout'
import Head from '../../../../components/atoms/Head'
import { useTranslation } from 'next-i18next'
import Breadcrumb from '../../../../components/organisms/Breadcrumb'
import { generateI18NPaths, getI18NProps } from '../../../../server/i18n'
import { useLocale } from '../../../../lib/i18n'
interface BattlesuitShowPageProps {
group: ErSignetGroup
@@ -20,6 +21,7 @@ interface BattlesuitShowPageProps {
const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
const { t } = useTranslation()
const locale = useLocale()
const signetSets = useMemo(() => {
const signetSetMap = signets.reduce<Map<string, ErSignet[]>>((map, signet) => {
@@ -56,7 +58,7 @@ const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
},
{
href: `/honkai3rd/er/signets/${group.id}`,
label: group.name
label: getSignetGroupLabel(group.id, locale)
}
]}
/>
@@ -77,7 +79,7 @@ const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
<Heading as="h3" my={0} ml={1}>
{signet.name}
</Heading>
<Box sx={{ ml: 12, color: 'textMuted' }}>{getErSignetTypeLabel(signet.quality)}</Box>
<Box sx={{ ml: 1, color: 'textMuted' }}>{getErSignetTypeLabel(signet.quality, locale)}</Box>
</Flex>
<Box sx={{ p: 1, borderBottom: 'default', '&:last-child': { borderBottom: 'none' } }}>
{signet.desc}
@@ -100,7 +102,7 @@ const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
export default BattlesuitShowPage
export async function getStaticProps({ locale, params }: NextPageContext & { params: { groupId: string } }) {
const signets = loadErSignets(params.groupId)
const signets = loadErSignets(params.groupId, locale)
const group = signetGroups.find(group => group.id === params.groupId)
return {
+3 -3
View File
@@ -52,7 +52,7 @@ const SupportsPage = ({
}
]}
/>
<Heading as="h1">ER Supports</Heading>
<Heading as="h1">{t('elysian-realm.supports')}</Heading>
<Card mb={3}>
{erSupports.map(support => {
@@ -84,8 +84,8 @@ const SupportsPage = ({
export default SupportsPage
export async function getStaticProps({ locale }: NextPageContext) {
const battlesuitCatalog = loadBattlesuitCatalog()
const erSupports = loadErSupports()
const battlesuitCatalog = loadBattlesuitCatalog(locale)
const erSupports = loadErSupports(locale)
return {
props: { battlesuitCatalog, erSupports, ...(await getI18NProps(locale)) }
@@ -187,9 +187,9 @@ const StigmataSetShowPage = ({ stigmataSet, stigmata }: StigmataSetShowPage) =>
export default StigmataSetShowPage
export async function getStaticProps({ locale, params }: NextPageContext & { params: { stigmataSetId: string } }) {
const stigmataSet = loadStigmataSetData(params.stigmataSetId)
const stigmataSet = loadStigmataSetData(params.stigmataSetId, locale)
const stigmata = stigmataSet.stigmaIdList.map(id => {
return loadStigmaData(id)
return loadStigmaData(id, locale)
})
return {
+1 -1
View File
@@ -94,7 +94,7 @@ const StigmataSetListPage = ({ stigmataSetCatalog }: StigmataSetListPageProps) =
export default StigmataSetListPage
export async function getStaticProps({ locale }: NextPageContext) {
const stigmataSetCatalog = loadStigmataSetCatalog()
const stigmataSetCatalog = loadStigmataSetCatalog(locale)
return {
props: { stigmataSetCatalog, ...(await getI18NProps(locale)) }
+7 -5
View File
@@ -15,6 +15,7 @@ import Head from '../../../components/atoms/Head'
import { useTranslation } from 'next-i18next'
import Breadcrumb from '../../../components/organisms/Breadcrumb'
import PageLink from '../../../components/atoms/PageLink'
import { useLocale } from '../../../lib/i18n'
interface StigmaShowPageProps {
rootStigma: RootStigma
@@ -23,6 +24,7 @@ interface StigmaShowPageProps {
const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPageProps) => {
const { t } = useTranslation()
const locale = useLocale()
const stigma = rootStigma.stigmata[rootStigma.stigmata.length - 1]
@@ -70,7 +72,7 @@ const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPagePr
<Box sx={{ p: 1, borderBottom: 'default' }}>{replaceNewLine(stigma.description)}</Box>
<Flex sx={{ alignItems: 'center', p: 1, borderBottom: 'default' }}>
<StigmaTypeIcon type={stigma.type} />
<Box ml={1}>{getStigmaTypeLabel(stigma.type)}</Box>
<Box ml={1}>{getStigmaTypeLabel(stigma.type, locale)}</Box>
</Flex>
<Box sx={{ p: 1 }}>
HP : {hp} / ATK : {atk} / DEF : {def} / CRT : {crt} (at Max Lv {stigma.maxLv})
@@ -148,7 +150,7 @@ const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPagePr
</Flex>
</>
)}
{/* <pre>{JSON.stringify(weapon, null, 2)}</pre> */}
{/* <pre>{JSON.stringify(stigma, null, 2)}</pre> */}
</Box>
</Honkai3rdLayout>
)
@@ -157,14 +159,14 @@ const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPagePr
export default StigmaShowPage
export async function getStaticProps({ locale, params }: NextPageContext & { params: { stigmaId: string } }) {
const rootStigma = loadStigmaData(params.stigmaId)
const rootStigma = loadStigmaData(params.stigmaId, locale)
const setId = rootStigma.stigmata[0].setId
let stigmataSetCatalogItem: StigmataSetCatalogItem | null = null
if (setId !== '0') {
const stigmataSet = loadStigmataSetData(setId)
const stigmataSet = loadStigmataSetData(setId, locale)
const setStigmataList = stigmataSet.stigmaIdList.map(id => {
const targetRootStigma = params.stigmaId === id ? rootStigma : loadStigmaData(id)
const targetRootStigma = params.stigmaId === id ? rootStigma : loadStigmaData(id, locale)
const maxedStigma = targetRootStigma.stigmata[targetRootStigma.stigmata.length - 1]
return {
id: targetRootStigma.id,
+2 -2
View File
@@ -26,7 +26,7 @@ const StigmataListPage = ({ stigmataCatalog }: StigmataListPageProps) => {
{ href: '/honkai3rd/stigmata', label: t('common.stigmata') }
]}
/>
<Heading as="h1">Stigmata (Single)</Heading>
<Heading as="h1">{t('stigmata-list.stigmata-single')}</Heading>
<Box mb={3}>
<PageLink href="/honkai3rd/stigmata-sets">{t('stigmata-list.show-set-list')}</PageLink>
@@ -70,7 +70,7 @@ const StigmataListPage = ({ stigmataCatalog }: StigmataListPageProps) => {
export default StigmataListPage
export async function getStaticProps({ locale }: NextPageContext) {
const stigmataCatalog = loadStigmataCatalog()
const stigmataCatalog = loadStigmataCatalog(locale)
return {
props: { stigmataCatalog, ...(await getI18NProps(locale)) }
+6 -3
View File
@@ -13,6 +13,7 @@ import Head from '../../../components/atoms/Head'
import { useTranslation } from 'next-i18next'
import { generateI18NPaths, getI18NProps } from '../../../server/i18n'
import Breadcrumb from '../../../components/organisms/Breadcrumb'
import { useLocale } from '../../../lib/i18n'
interface WeaponShowPageProps {
rootWeapon: RootWeaponData
@@ -20,9 +21,11 @@ interface WeaponShowPageProps {
const WeaponShowPage = ({ rootWeapon }: WeaponShowPageProps) => {
const { t } = useTranslation()
const locale = useLocale()
const weapon = rootWeapon.weapons[rootWeapon.weapons.length - 1]
const weaponTypeLabel = getWeaponTypeLabel(weapon.type)
const weaponTypeLabel = getWeaponTypeLabel(weapon.type, locale)
const atk = Math.floor(weapon.attackBase + weapon.attackAdd * (weapon.maxLv - 1))
const crt = Math.floor(weapon.criticalBase + weapon.criticalAdd * (weapon.maxLv - 1))
@@ -54,7 +57,7 @@ const WeaponShowPage = ({ rootWeapon }: WeaponShowPageProps) => {
<Box sx={{ p: 1, borderBottom: 'default' }}>{replaceNewLine(weapon.description)}</Box>
<Flex sx={{ alignItems: 'center', p: 1, borderBottom: 'default' }}>
<WeaponTypeIcon type={weapon.type} />
<Box ml={1}>{getWeaponTypeLabel(weapon.type)}</Box>
<Box ml={1}>{getWeaponTypeLabel(weapon.type, locale)}</Box>
</Flex>
<Box sx={{ p: 1 }}>
ATK : {atk} / CRT : {crt} (at Max Lv {weapon.maxLv})
@@ -112,7 +115,7 @@ const WeaponShowPage = ({ rootWeapon }: WeaponShowPageProps) => {
export default WeaponShowPage
export async function getStaticProps({ locale, params }: NextPageContext & { params: { weaponId: string } }) {
const rootWeapon = loadWeaponData(params.weaponId)
const rootWeapon = loadWeaponData(params.weaponId, locale)
return {
props: { rootWeapon, ...(await getI18NProps(locale)) }
+1 -1
View File
@@ -72,7 +72,7 @@ const WeaponListPage = ({ weaponCatalog }: WeaponListPageProps) => {
export default WeaponListPage
export async function getStaticProps({ locale }: NextPageContext) {
const weaponCatalog = loadWeaponCatalog()
const weaponCatalog = loadWeaponCatalog(locale)
return {
props: { weaponCatalog, ...(await getI18NProps(locale)) }