refactor: support i18n in frontend

This commit is contained in:
2026-07-21 19:34:19 +08:00
parent 1a9eb9299b
commit e16a40148a
24 changed files with 628 additions and 400 deletions
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { computed } from 'vue';
import { WEEK_NAMES } from '@/utils/i18n';
import type { CalendarCell } from './types';
import CalendarItem from './CalendarItem.vue';
@@ -22,8 +21,8 @@ const rows = computed<CalendarCell[][]>(() => {
<template>
<div class="calendarGrid card" style="padding: 1.25rem; display: flex; flex-flow: column;">
<div style="margin: 0 0 0.75em 0;">
<div v-for="(w, i) in WEEK_NAMES" :key="i">
<b :style="i >= 5 ? { color: 'red' } : null">{{ w }}</b>
<div v-for="i in 7" :key="i">
<b :style="i >= 6 ? { color: 'red' } : null">{{ $t('universal-week-' + i) }}</b>
</div>
</div>