[+] Switching games in leaderboard

This commit is contained in:
Azalea
2024-03-14 22:35:36 -04:00
parent 7bbd90ab91
commit 10d19a5392
6 changed files with 46 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
import { EN_REF, type LocalizedMessages } from "./i18n/en_ref";
import { ZH } from "./i18n/zh";
import type { GameName } from "./scoring";
type Lang = 'en' | 'zh'
@@ -22,3 +23,6 @@ export function t(key: keyof LocalizedMessages, variables?: { [index: string]: a
}
return msgs[lang][key]
}
export const GAME_TITLE: { [key in GameName]: string } =
{chu3: t("game.chu3"), mai2: t("game.mai2"), ongeki: t("game.ongeki")}

View File

@@ -17,9 +17,6 @@ export const EN_REF_USER = {
'UserHome.Version': 'Last Version',
'UserHome.RecentScores': 'Recent Scores',
'UserHome.NoData': 'No data in the past ${days} days',
'UserHome.Game.Mai2': "Mai",
'UserHome.Game.Chu3': "Chuni",
'UserHome.Game.Ongeki': "Ongeki",
'UserHome.UnknownSong': "(unknown song)",
'UserHome.Settings': 'Settings',
'UserHome.NoValidGame': "The user hasn't played any game yet.",
@@ -46,6 +43,12 @@ export const EN_REF_Welcome = {
'welcome.verification-failed': 'Verification failed: ${message}. Please try again.',
}
export const EN_REF = { ...EN_REF_USER, ...EN_REF_Welcome }
export const EN_REF_GENERAL = {
'game.mai2': "Mai",
'game.chu3': "Chuni",
'game.ongeki': "Ongeki",
}
export const EN_REF = { ...EN_REF_USER, ...EN_REF_Welcome, ...EN_REF_GENERAL }
export type LocalizedMessages = typeof EN_REF

View File

@@ -1,4 +1,4 @@
import { EN_REF_USER, type EN_REF_Welcome } from "./en_ref";
import { EN_REF_GENERAL, EN_REF_USER, type EN_REF_Welcome } from "./en_ref";
const zhUser: typeof EN_REF_USER = {
'UserHome.ServerRank': '服务器排名',
@@ -19,9 +19,6 @@ const zhUser: typeof EN_REF_USER = {
'UserHome.Version': '最新最热否',
'UserHome.RecentScores': '成绩',
'UserHome.NoData': '过去 ${days} 天内没有玩过',
'UserHome.Game.Mai2': "舞萌",
'UserHome.Game.Chu3': "中二",
'UserHome.Game.Ongeki': "音击",
'UserHome.UnknownSong': "(未知曲目)",
'UserHome.Settings': '设置',
'UserHome.NoValidGame': "用户还没有玩过游戏",
@@ -48,4 +45,10 @@ const zhWelcome: typeof EN_REF_Welcome = {
'welcome.verification-failed': '验证失败:${message}。请重试',
}
export const ZH = { ...zhUser, ...zhWelcome }
const zhGeneral: typeof EN_REF_GENERAL = {
'game.mai2': "舞萌",
'game.chu3': "中二",
'game.ongeki': "音击",
}
export const ZH = { ...zhUser, ...zhWelcome, ...zhGeneral }