Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1
version: v2
plugins:
- plugin: es
- local: protoc-gen-es
out: server/internal/proto
opt: target=ts
2 changes: 1 addition & 1 deletion components/PieChart/PieChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{{
$t("common.labelValueColon", {
label: slice.label,
value: slice.value,
value: $n(slice.value),
})
}}
</li>
Expand Down
3 changes: 2 additions & 1 deletion components/ProgressBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<span
class="absolute inset-0 flex items-center justify-center text-blue-200 text-sm font-bold font-display"
>
{{ $t("tasks.admin.progress", [Math.round(percentage * 10) / 10]) }}
<!-- {{ $t("tasks.admin.progress", [Math.round(percentage * 10) / 10]) }} -->
{{ $n(Math.round(percentage) / 100, "percent") }}
</span>
</div>
</template>
Expand Down
19 changes: 19 additions & 0 deletions i18n/i18n.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ export default defineI18nConfig(() => {
},
} as const;

const defaultNumberFormat = {
percent: {
style: "percent",
useGrouping: false,
},
} as const;

return {
// https://i18n.nuxtjs.org/docs/guide/locale-fallback
fallbackLocale: "en-us",
Expand All @@ -31,5 +38,17 @@ export default defineI18nConfig(() => {
zh: defaultDateTimeFormat,
"zh-tw": defaultDateTimeFormat,
},
numberFormats: {
"en-us": defaultNumberFormat,
"en-gb": defaultNumberFormat,
"en-au": defaultNumberFormat,
"en-pirate": defaultNumberFormat,
fr: defaultNumberFormat,
de: defaultNumberFormat,
it: defaultNumberFormat,
es: defaultNumberFormat,
zh: defaultNumberFormat,
"zh-tw": defaultNumberFormat,
},
};
});
18 changes: 14 additions & 4 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ const packageJsonSchema = type({
version: "string",
});

const twemojiJson = module.findPackageJSON(
const twemojiPackage = module.findPackageJSON(
"@discordapp/twemoji",
import.meta.url,
);
if (!twemojiJson) {
if (!twemojiPackage) {
throw new Error("Could not find @discordapp/twemoji package.");
}
const twemojiAssetsPath = path.join(
path.dirname(twemojiPackage),
"dist",
"svg",
);

// get drop version
const dropVersion = getDropVersion();
Expand Down Expand Up @@ -96,10 +101,14 @@ export default defineNuxtConfig({

// redirect old OIDC callback route
"/auth/callback/oidc": {
redirect: "/api/v1/auth/odic/callback",
redirect: "/api/v1/auth/oidc/callback",
},
},

devServer: {
port: 4000,
},

nitro: {
minify: true,
compressPublicAssets: true,
Expand Down Expand Up @@ -143,7 +152,7 @@ export default defineNuxtConfig({
{
baseName: "twemoji",
// get path to twemoji svg assets
dir: path.join(path.dirname(twemojiJson), "dist", "svg"),
dir: twemojiAssetsPath,
},
],
},
Expand All @@ -169,6 +178,7 @@ export default defineNuxtConfig({
optimizeTranslationDirective: false,
},
defaultLocale: "en-us",
lazy: true,
strategy: "no_prefix",
experimental: {
localeDetector: "localeDetector.ts",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@lobomfz/prismark": "0.0.3",
"@nuxt/fonts": "^0.11.0",
"@nuxt/image": "^1.10.0",
"@nuxt/kit": "3.20.1",
"@nuxt/kit": "^3.20.1",
"@nuxtjs/i18n": "^9.5.5",
"@prisma/client": "^6.11.1",
"@simplewebauthn/browser": "^13.2.2",
Expand All @@ -50,7 +50,7 @@
"luxon": "^3.6.1",
"micromark": "^4.0.1",
"normalize-url": "^8.0.2",
"nuxt": "^3.17.4",
"nuxt": "^3.20.1",
"nuxt-security": "2.2.0",
"otp-io": "^1.2.7",
"parse-cosekey": "^1.0.2",
Expand Down Expand Up @@ -100,5 +100,5 @@
"vue3-carousel": "^0.16.0"
}
},
"packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a"
"packageManager": "pnpm@10.29.1+sha512.48dae233635a645768a3028d19545cacc1688639eeb1f3734e42d6d6b971afbf22aa1ac9af52a173d9c3a20c15857cfa400f19994d79a2f626fcc73fccda9bbc"
}
49 changes: 35 additions & 14 deletions pages/admin/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>

<div class="col-span-6 lg:col-span-1 md:col-span-3">
<MiniTile :label="t('home.admin.games')" :value="gameCount">
<MiniTile :label="t('home.admin.games')" :value="$n(gameCount)">
<template #icon>
<GamepadIcon />
</template>
Expand All @@ -33,24 +33,45 @@
<div
class="col-span-6 lg:col-span-1 md:col-span-3 row-span-1 lg:col-start-1 lg:row-start-2"
>
<MiniTile
:value="sources.length"
:label="t('home.admin.librarySources')"
>
<template #icon>
<ServerStackIcon />
</template>
</MiniTile>
<TileWithLink>
<div class="h-full flex">
<div class="flex-1 my-auto">
<ServerStackIcon />
</div>
<div
class="flex-6 lg:flex-2 my-auto text-center flex lg:inline mx-4"
>
<div class="text-3xl flex-1 font-bold">
{{ $n(sources.length) }}
</div>
<div class="text-xs flex-1 text-left lg:text-center">
{{ t("home.admin.librarySources") }}
</div>
</div>
</div>
</TileWithLink>
</div>

<div
class="col-span-6 lg:col-span-1 md:col-span-3 row-span-1 lg:col-start-2 lg:row-start-2"
>
<MiniTile :value="userStats.userCount" :label="t('home.admin.users')">
<template #icon>
<UserGroupIcon />
</template>
</MiniTile>
<TileWithLink>
<div class="h-full flex">
<div class="flex-1 my-auto">
<UserGroupIcon />
</div>
<div
class="flex-6 lg:flex-2 my-auto text-center flex lg:inline mx-4"
>
<div class="text-3xl flex-1 font-bold">
{{ $n(userStats.userCount) }}
</div>
<div class="text-xs flex-1 text-left lg:text-center">
{{ t("home.admin.users") }}
</div>
</div>
</div>
</TileWithLink>
</div>

<div class="col-span-6 row-span-1 lg:col-span-2 lg:row-span-2">
Expand Down
2 changes: 1 addition & 1 deletion pages/store/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
]"
/>
<span class="text-zinc-600">{{
$t("store.reviews", [rating._sum.mReviewCount ?? 0])
$t("store.reviews", [$n(rating._sum.mReviewCount ?? 0)])
}}</span>
</td>
</tr>
Expand Down
Loading