Introduce i18n

This commit is contained in:
Sakura Knoll
2022-01-03 13:22:37 +09:00 Unverified
parent d6a8a0e7b0
commit 8bc576208a
20 changed files with 198 additions and 58 deletions
+4 -1
View File
@@ -9,6 +9,8 @@ import FilterButton from '../../../components/atoms/FilterButton'
import { useRouter } from 'next/router'
import { WeaponData } from '../../../lib/honkai3rd/weapons'
import WeaponCard from '../../../components/molecules/WeaponCard'
import { getI18NProps } from '../../../lib/i18n'
import { NextPageContext } from 'next'
type WeaponListItemData = Pick<
WeaponData,
@@ -94,12 +96,13 @@ const WeaponListPage = ({ weaponDataList }: WeaponListPageProps) => {
export default WeaponListPage
export async function getStaticProps() {
export async function getStaticProps({ locale }: NextPageContext) {
return {
props: {
weaponDataList: listWeapons().map((weapon) => {
return pick(['name', 'id', 'rarity', 'category'], weapon)
}),
...(await getI18NProps(locale)),
},
}
}