Skip to content

Commit

Permalink
feat(colors): i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
outloudvi committed Oct 6, 2022
1 parent 98e5376 commit 432e50a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
4 changes: 4 additions & 0 deletions locales/en/colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"Colors": "Colors",
"colors_header": "The colors come from in-game data. Also for reference: <a>Image from official Twitter</a>."
}
4 changes: 4 additions & 0 deletions locales/zh-hans/colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"Colors": "系列颜色",
"colors_header": "此颜色根据游戏内部数据得到。亦可参考<a>官方 Twitter</a>提供的图片。"
}
19 changes: 12 additions & 7 deletions pages/colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ const ColorsPage = ({
CharacterList: APIResponseOf<'Character/List'>
}) => {
const $vc = useTranslations('v-chr')
const $t = useTranslations('colors')

return (
<>
<p>
此颜色根据游戏内部数据得到。亦可参考
<a href="https://twitter.com/idolypride/status/1332167024433192961">
官方 Twitter
</a>{' '}
提供的图片。
{$t.rich('colors_header', {
a: (c) => (
<a href="https://twitter.com/idolypride/status/1332167024433192961">
{c}
</a>
),
})}
</p>
<div className="flex flex-col">
{ColorOrder.map((row, _i) => (
Expand All @@ -79,14 +83,15 @@ const ColorsPage = ({

const SkeletonColorsPage = () => {
const { data: CharacterList } = useApi('Character/List')
const $t = useTranslations('colors')

const allData = {
CharacterList,
}

return (
<>
<Title title="系列颜色" />
<Title title={$t('Colors')} />
{allFinished(allData) ? (
<ColorsPage {...allData} />
) : (
Expand All @@ -96,6 +101,6 @@ const SkeletonColorsPage = () => {
)
}

export const getStaticProps = getI18nProps(['vendor', 'v-chr'])
export const getStaticProps = getI18nProps(['colors', 'vendor', 'v-chr'])

export default SkeletonColorsPage

0 comments on commit 432e50a

Please sign in to comment.