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
+2 -1
View File
@@ -144,10 +144,11 @@
}
},
"elysian-realm": {
"elysian-realm": "Elysian Realm",
"battlesuits": "Battlesuits",
"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"
+4 -50
View File
@@ -38,13 +38,13 @@
"description": "붕괴 3rd 성흔 목록",
"stigmata-single": "성흔 (단일)",
"set-list": "세트 일람",
"show-set-list": "단일 성흔 목록"
"show-set-list": "세트 성흔 목록으로 보기"
},
"stigmata-set-list": {
"description": "붕괴 3rd 성흔 세트 목록",
"stigmata-set": "성흔 (세트)",
"set-list": "세트 일람",
"show-signle-list": "단일 성흔 목록"
"show-signle-list": "단일 성흔 목록으로 보기"
},
"stigmata-show": {
"stigmata": "성흔",
@@ -86,58 +86,12 @@
"ultimate": "필살기",
"team": "팀"
},
"versions": {
"version": "업데이트",
"list-page-description": "붕괴 3rd 업데이트 정보 목록",
"all-versions": "모든 업데이트",
"versions": "업데이트",
"previous": "이전 버전",
"next": "다음 버전",
"current": "현재 버전",
"new-battlesuits": "신규 발키리",
"new-weapons": "신규 무기",
"new-stigmata-sets": "신규 성흔 세트",
"weekly-bosses": "주간 보스",
"super-string": "초끈 공간",
"memorial-arena": "기억 전장",
"supply-events": "보급 이벤트",
"supply-events-disclaimer": "주의: 보급 일정은 글로벌 아메리카 서버 기준으로 작성되어 있습니다. 수작업으로 갱신하기에 정확하지 않은 부분이 있을 수도 있습니다. 보급 가차를 돌리기 전에 게임 내 정보를 꼭 다시 한번 확인해주세요."
},
"sources": {
"sprit-weapon-foundry": {
"label": "진영 무기 단조",
"description": "150 x 네겐트로피 허수 코어, 300 x 플로지스톤 에테르, 1 x 50 레벨 진영 무기(190 x G1 결정, 80 x 붕괴의 파편, 400 x 플로지스톤 에테르)로 단조."
},
"dorm-equipment-supply": {
"label": "본부 장비 보급",
"description": "보급마다 200 x 수정을 소모. 뽑지 않기를 추천함. 대부분의 아이템들은 치환 공간에서 구할 수 있음."
},
"focused-supply": {
"label": "집중 보급",
"description": "보급마다 280 x 수정을 소모."
},
"pri-weapon-foundry": {
"label": "초월 무기 단조",
"description": "원형 무기 획득 후, 100 x 아인슈타인 토러스, 15 x 나노 세라믹, 50 x 초전도 금속성 수소, 1 x 같은 종류의 50레벨 5성 보급 무기로 단조."
},
"weapon-exchange": {
"label": "치환 공간",
"description": "4000 x 무장 공명으로 교환."
},
"stigmata-exchange": {
"label": "치환 공간",
"description": "6000 x 성흔 공명으로 교환."
},
"special-divine-key-supply": {
"label": "신의 열쇠 보급",
"description": "천명 무기고나 화력 보급등 특수 보급 이벤트에서만 획득 가능. 보급마다 280 x 수정을 소모."
}
},
"elysian-realm": {
"elysian-realm": "과거의 낙원",
"battlesuits": "발키리",
"signets": "각인",
"remembrance-sigil": "회상의 증명",
"supports": "지원 발키리",
"no-upgrades": "레벨업 불가능",
"nexus-signets": "증폭 각인",
"normal-signets": "일반 각인",
"exclusive-signets": "전용 각인"
@@ -1,41 +0,0 @@
/** @jsxImportSource theme-ui */
import { Flex, Text } from '@theme-ui/components'
import { useRouter } from 'next/router'
import { assetsBucketBaseUrl } from '../../lib/consts'
import { battlesuitFeatures } from '../../lib/honkai3rd/battlesuits'
import { translate } from '../../lib/i18n'
import SquareImageBox from './SquareImageBox'
interface BattlesuitFeatureLabelProps {
feature: string
}
const BattlesuitFeatureLabel = ({ feature }: BattlesuitFeatureLabelProps) => {
const { locale } = useRouter()
const featureData = battlesuitFeatures.find(
(aFeature) => aFeature.value === feature
)
if (featureData == null) {
return <Text>{feature}</Text>
}
const { label, icon, krLabel } = featureData
const translatedLabel = translate(locale, { 'ko-KR': krLabel }, label)
return (
<Flex sx={{ alignItems: 'center' }}>
{featureData != null && (
<SquareImageBox
size={30}
src={`${assetsBucketBaseUrl}/honkai3rd/${icon}.png`}
alt={translatedLabel}
mr={1}
/>
)}
<Text>{translatedLabel}</Text>
</Flex>
)
}
export default BattlesuitFeatureLabel
+5 -3
View File
@@ -8,9 +8,10 @@ import SquareImageBox from '../atoms/SquareImageBox'
type NavItemTarget = 'battlesuits' | 'stigmata' | 'weapons' | 'elfs' | 'elysian-realm' | 'media'
interface NavItemProps {
target: NavItemTarget
size?: 'md' | 'lg'
}
const NavItem = ({ target }: NavItemProps) => {
const NavItem = ({ target, size = 'md' }: NavItemProps) => {
const { t } = useTranslation()
return (
<NextLink href={getHref(target)} passHref>
@@ -23,12 +24,13 @@ const NavItem = ({ target }: NavItemProps) => {
p: 1
}}
>
<SquareImageBox size={30} mr={1} src={getIconByTarget(target)} />
<SquareImageBox size={size === 'lg' ? 50 : 30} mr={size === 'lg' ? 2 : 1} src={getIconByTarget(target)} />
<Text
sx={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
whiteSpace: 'nowrap',
fontSize: size === 'lg' ? 3 : undefined
}}
>
{t(`common.${target}`)}
-54
View File
@@ -1,54 +0,0 @@
/** @jsxImportSource theme-ui */
import { Flex, Text } from '@theme-ui/components'
import { useRouter } from 'next/router'
import { assetsBucketBaseUrl } from '../../lib/consts'
import { battlesuitTypes } from '../../lib/honkai3rd/battlesuits'
import { translate } from '../../lib/i18n'
import { capitalize } from '../../lib/string'
import SquareImageBox from './SquareImageBox'
interface TypeLabelProps {
type: string
}
const TypeLabel = ({ type }: TypeLabelProps) => {
const battlesuitType = battlesuitTypes.find((aType) => aType.value === type)
const { locale } = useRouter()
const label =
battlesuitType != null
? translate(
locale,
{ 'ko-KR': battlesuitType.krLabel },
battlesuitType.label
)
: capitalize(type)
return (
<Flex sx={{ alignItems: 'center' }}>
{isValidType(type) && (
<SquareImageBox
size={30}
src={`${assetsBucketBaseUrl}/honkai3rd/type-icons/${type}.png`}
alt={label}
mr={1}
/>
)}
<Text>{label}</Text>
</Flex>
)
}
export default TypeLabel
function isValidType(type: string): boolean {
switch (type) {
case 'mecha':
case 'biologic':
case 'psychic':
case 'quantum':
case 'imaginary':
return true
}
return false
}
-36
View File
@@ -1,36 +0,0 @@
/** @jsxImportSource theme-ui */
import { Flex, Text } from '@theme-ui/components'
import { useRouter } from 'next/router'
import { assetsBucketBaseUrl } from '../../lib/consts'
import { valkyries } from '../../lib/honkai3rd/battlesuits'
import { translate } from '../../lib/i18n'
import SquareImageBox from './SquareImageBox'
interface ValkyrieLabelProps {
valkyrie: string
}
const ValkyrieLabel = ({ valkyrie }: ValkyrieLabelProps) => {
const { icon, label, krLabel } = valkyries.find(
(aValkyrie) => aValkyrie.value === valkyrie
) || { label: valkyrie, krLabel: valkyrie }
const { locale } = useRouter()
const translatedLabel = translate(locale, { 'ko-KR': krLabel }, label)
return (
<Flex sx={{ alignItems: 'center' }}>
{icon && (
<SquareImageBox
size={30}
src={`${assetsBucketBaseUrl}/honkai3rd/${icon}.png`}
alt={translatedLabel}
mr={1}
/>
)}
<Text>{translatedLabel}</Text>
</Flex>
)
}
export default ValkyrieLabel
@@ -20,7 +20,6 @@ const BattlesuitCatalogItemCard = ({ battlesuit, label = false }: BattlesuitCata
textAlign: 'center',
overflow: 'hidden',
width: 110,
marginLeft: -10,
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}}
+6
View File
@@ -1,4 +1,5 @@
import { useTranslation } from 'next-i18next'
import { useRouter } from 'next/router'
export function translate(
targetLocale: string = 'en_US',
@@ -9,3 +10,8 @@ export function translate(
}
export { useTranslation }
export function useLocale() {
const { locale } = useRouter()
return locale || 'en-US'
}
+14 -14
View File
@@ -1,16 +1,16 @@
export const signetGroups = [
{ id: '1', name: '[구원]의 각인', icon: 'Kevin' },
{ id: '2', name: '[황금]의 각인', icon: 'Eden' },
{ id: '3', name: '[오멸]의 각인', icon: 'Kalpas' },
{ id: '4', name: '[천혜]의 각인', icon: 'Su' },
{ id: '5', name: '[찰나]의 각인', icon: 'Sakura' },
{ id: '6', name: '[무한]의 각인', icon: 'Mobius' },
{ id: '7', name: '[부생]의 각인', icon: 'Hua' },
// { id: '8', name: '[■■]의 각인', icon: 'Elysia' },
// { id: '9', name: '[■■]의 각인', icon: 'Elysia' },
{ id: '10', name: '[계율]의 각인', icon: 'Aponia' },
{ id: '11', name: '[나선]의 각인', icon: 'Verve' },
{ id: '12', name: '[욱광]의 각인', icon: 'Kosma' },
{ id: '13', name: '[번성]의 각인', icon: 'Griseo' },
{ id: '14', name: '[환몽]의 각인', icon: 'Pardofelis' }
{ id: '1', icon: 'Kevin' },
{ id: '2', icon: 'Eden' },
{ id: '3', icon: 'Kalpas' },
{ id: '4', icon: 'Su' },
{ id: '5', icon: 'Sakura' },
{ id: '6', icon: 'Mobius' },
{ id: '7', icon: 'Hua' },
// { id: '8', icon: 'Elysia' },
// { id: '9', icon: 'Elysia' },
{ id: '10', icon: 'Aponia' },
{ id: '11', icon: 'Verve' },
{ id: '12', icon: 'Kosma' },
{ id: '13', icon: 'Griseo' },
{ id: '14', icon: 'Pardofelis' }
]
+173 -10
View File
@@ -1,6 +1,24 @@
import { AttributeType, CharacterType, SkillType, StigmaType, TagType, WeaponType } from './types'
export function getAttributeLabel(type: AttributeType) {
export function getAttributeLabel(type: AttributeType, locale: string) {
if (locale === 'en-US') {
switch (type) {
case 'bio':
return 'Biologic'
case 'psy':
return 'Psychic'
case 'mech':
return 'Mecha'
case 'qua':
return 'Quantum'
case 'img':
return 'IMG'
case 'none':
return 'None'
default:
return `Unknown Attribute Type (${type})`
}
}
switch (type) {
case 'bio':
return '생물'
@@ -19,7 +37,35 @@ export function getAttributeLabel(type: AttributeType) {
}
}
export function getWeaponTypeLabel(type: WeaponType) {
export function getWeaponTypeLabel(type: WeaponType, locale: string) {
if (locale === 'en-US') {
switch (type) {
case 'pistols':
return 'Pistols'
case 'katana':
return 'Blade'
case 'cannon':
return 'Heavy'
case 'cross':
return 'Cross'
case '2-handed':
return '2-Handed'
case 'scythe':
return 'Scythe'
case 'lance':
return 'Lance'
case 'fists':
return 'Fists'
case 'bow':
return 'Bow'
case 'chakram':
return 'Chakram'
case 'javelin':
return 'Javelin'
default:
return `Unknown Weapon Type (${type})`
}
}
switch (type) {
case 'pistols':
return '쌍권총'
@@ -48,7 +94,19 @@ export function getWeaponTypeLabel(type: WeaponType) {
}
}
export function getStigmaTypeLabel(type: StigmaType) {
export function getStigmaTypeLabel(type: StigmaType, locale: string) {
if (locale === 'en-US') {
switch (type) {
case 'top':
return 'Top'
case 'mid':
return 'Mid'
case 'bot':
return 'Bot'
default:
return `Unknown Stigma Type (${type})`
}
}
switch (type) {
case 'top':
return '상단'
@@ -61,7 +119,29 @@ export function getStigmaTypeLabel(type: StigmaType) {
}
}
export function getSkillTypeLabel(type: SkillType) {
export function getSkillTypeLabel(type: SkillType, locale: string) {
if (locale === 'en-US') {
switch (type) {
case 'leader':
return 'Leader Skill'
case 'passive':
return 'Passive'
case 'evasion':
return 'Evade'
case 'special':
return 'Special Attack'
case 'ultimate':
return 'Ultimate'
case 'basic':
return 'Basic Skill'
case 'sp':
return 'SP Skill'
case 'none':
return 'None'
default:
return `Unknown Skill Type (${type})`
}
}
switch (type) {
case 'leader':
return '리더 스킬'
@@ -70,7 +150,7 @@ export function getSkillTypeLabel(type: SkillType) {
case 'evasion':
return '회피'
case 'special':
return '기본 공격'
return '특수 공격'
case 'ultimate':
return '필살기'
case 'basic':
@@ -84,7 +164,7 @@ export function getSkillTypeLabel(type: SkillType) {
}
}
export function getCharacterTypeLabel(type: CharacterType, locale: string = 'en-US') {
export function getCharacterTypeLabel(type: CharacterType, locale: string) {
if (locale === 'en-US') {
switch (type) {
case 'kiana':
@@ -249,8 +329,8 @@ export function getCharacterTypeLabel(type: CharacterType, locale: string = 'en-
}
}
export function getTagTypeLabel(type: TagType, locale: string = 'en-US') {
if (type) {
export function getTagTypeLabel(type: TagType, locale: string) {
if (locale === 'en-US') {
switch (type) {
case 'branch':
return 'Branch'
@@ -362,7 +442,21 @@ export function getTagTypeLabel(type: TagType, locale: string = 'en-US') {
}
}
export function getErSignetTypeLabel(quality: number) {
export function getErSignetTypeLabel(quality: number, locale: string) {
if (locale === 'en-US') {
switch (quality) {
case 1:
return 'Normal Signet'
case 2:
return 'Enhanced Signet'
case 3:
return 'Core Signet'
case 4:
return 'Exclusive Signet'
default:
return `Unknown (${quality})`
}
}
switch (quality) {
case 1:
return '일반 각인'
@@ -373,6 +467,75 @@ export function getErSignetTypeLabel(quality: number) {
case 4:
return '전용 각인'
default:
return `Unknown (${quality})`
return `Unknown Signet Type(${quality})`
}
}
export function getSignetGroupLabel(id: string, locale: string) {
if (locale === 'en-US') {
switch (id) {
case '1':
return 'Deliverance'
case '2':
return 'Gold'
case '3':
return 'Decimation'
case '4':
return 'Bodhi'
case '5':
return 'Setsuna'
case '6':
return 'Infinity'
case '7':
return 'Vicissitude'
case '8':
return '■■'
case '9':
return '■■'
case '10':
return 'Discipline'
case '11':
return 'Helix'
case '12':
return 'Daybreak'
case '13':
return 'Stars'
case '14':
return 'Reverie'
default:
return `Unknown Signet Group (${id})`
}
}
switch (id) {
case '1':
return '[구원]의 각인'
case '2':
return '[황금]의 각인'
case '3':
return '[오멸]의 각인'
case '4':
return '[천혜]의 각인'
case '5':
return '[찰나]의 각인'
case '6':
return '[무한]의 각인'
case '7':
return '[부생]의 각인'
case '8':
return '[■■]의 각인'
case '9':
return '[■■]의 각인'
case '10':
return '[계율]의 각인'
case '11':
return '[나선]의 각인'
case '12':
return '[욱광]의 각인'
case '13':
return '[번성]의 각인'
case '14':
return '[환몽]의 각인'
default:
return `Unknown Signet Group (${id})`
}
}
+5 -3
View File
@@ -1,4 +1,4 @@
import { BattlesuitSkill, CharacterType, TagType } from './types'
import { AttributeType, BattlesuitSkill, CharacterType, TagType } from './types'
export function sortBattlesuitSkill(a: BattlesuitSkill, b: BattlesuitSkill) {
return reversedSkillTypeOrder.indexOf(b.skillType) - reversedSkillTypeOrder.indexOf(a.skillType)
@@ -6,6 +6,8 @@ export function sortBattlesuitSkill(a: BattlesuitSkill, b: BattlesuitSkill) {
const reversedSkillTypeOrder = ['leader', 'passive', 'evasion', 'special', 'ultimate', 'basic', 'sp', 'none'].reverse()
export const attributeTypes: AttributeType[] = ['bio', 'psy', 'mech', 'qua', 'img']
export const characterFilterTypes: CharacterType[] = [
'kiana',
'mei',
@@ -56,6 +58,6 @@ export const tagFilterTypes: TagType[] = [
'gather',
'heal',
'fast-atk',
'aerial',
'burst'
'burst',
'aerial'
]
@@ -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)) }