Skip to content

Commit

Permalink
fix status
Browse files Browse the repository at this point in the history
  • Loading branch information
arily committed Apr 27, 2024
1 parent 26c851b commit a16bfe4
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/locales/@types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { DeepPartial } from '@trpc/server'
import type { CountryCode } from '../def/country-code'
import type { GucchoError } from '../server/trpc/messages'
import type { Mail } from '../def/mail'
import type { RankingStatus } from '../def/beatmap'
import type { Scope, UserRole } from '~/def/user'
import { Lang, type Rank } from '~/def'
import type { ActiveMode, ActiveRuleset } from '~/def/common'
Expand Down Expand Up @@ -53,6 +54,10 @@ export interface GlobalI18n extends PathAccessibleObject {
mode: Record<ActiveMode, string>
ruleset: Record<ActiveRuleset, string>
rank: Record<Rank, string>

beatmap: {
status: Record<RankingStatus, string>
}
role: Record<UserRole, string>
scope: Record<Scope, string>
titles: Record<
Expand Down
17 changes: 17 additions & 0 deletions src/locales/base/en-GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Scope, UserRole } from '~/def/user'
import { Mail } from '~/def/mail'
import { Mode, Rank, Ruleset } from '~/def'
import { GucchoError } from '~/server/trpc/messages'
import { RankingStatus } from '~/def/beatmap'

export default {
server: {
Expand Down Expand Up @@ -94,6 +95,22 @@ export default {
ranks: 'Leaderboard',
sessions: 'Web Login',
},

beatmap: {
status: {
[RankingStatus.Graveyard]: 'Graveyard',
[RankingStatus.WIP]: 'WIP',
[RankingStatus.Pending]: 'Pending',
[RankingStatus.Ranked]: 'Ranked',
[RankingStatus.Approved]: 'Approved',
[RankingStatus.Qualified]: 'Qualified',
[RankingStatus.Loved]: 'Loved',
[RankingStatus.Deleted]: 'Deleted',
[RankingStatus.NotFound]: 'Not Found',
[RankingStatus.Unknown]: 'Unknown',
},
},

error: {
[GucchoError.UnknownError]: 'An unknown error occurred.',
[GucchoError.UserNotFound]: 'User not found.',
Expand Down
20 changes: 18 additions & 2 deletions src/locales/base/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { GlobalI18n } from '../@types'
import { CountryCode } from '~/def/country-code'
import { Rank } from '~/def'
import { Scope, UserRole } from '~/def/user'
import { RankingStatus } from '~/def/beatmap'
import { CountryCode } from '~/def/country-code'
import { Mail } from '~/def/mail'
import { Scope, UserRole } from '~/def/user'
import { GucchoError } from '~/server/trpc/messages'

export default {
Expand Down Expand Up @@ -91,6 +92,21 @@ export default {
sessions: '网站登录',
},

beatmap: {
status: {
[RankingStatus.Graveyard]: '坟图',
[RankingStatus.WIP]: '未完成',
[RankingStatus.Pending]: 'Pending',
[RankingStatus.Ranked]: 'Ranked',
[RankingStatus.Approved]: 'Approved',
[RankingStatus.Qualified]: 'Qualified',
[RankingStatus.Loved]: 'Loved',
[RankingStatus.Deleted]: '已被删除',
[RankingStatus.NotFound]: '找不到',
[RankingStatus.Unknown]: '未知',
},
},

error: {
[GucchoError.UnknownError]: '未知错误',
[GucchoError.MissingServerAvatarConfig]: '头像配置缺失',
Expand Down
5 changes: 3 additions & 2 deletions src/pages/beatmapset/[id].vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<script setup lang="ts">
import { BeatmapSource } from '~/def/beatmap'
import { BeatmapSource, RankingStatus } from '~/def/beatmap'
import { Mode } from '~/def'
import { type AppScoresRankingSystemSwitcher } from '#components'
import type { Label } from '~/composables/useLinks'
definePageMeta({
alias: ['/s/:id', '/beatmapsets/:id'],
})
const app = useNuxtApp()
const route = useRoute('beatmapset-id')
const { supportedModes, supportedRulesets, hasRankingSystem, hasRuleset }
Expand Down Expand Up @@ -365,7 +366,7 @@ fr-FR:
{{ t("beatmapset.status") }}
</dt>
<dd class="flex gap-1 striped-text">
{{ selectedMap.status }}
{{ RankingStatus[selectedMap.status as any] }}
</dd>
</div>
<div class="striped">
Expand Down

0 comments on commit a16bfe4

Please sign in to comment.