diff --git a/locales/zh-TW/common.json b/locales/zh-TW/common.json new file mode 100644 index 0000000..e787bf4 --- /dev/null +++ b/locales/zh-TW/common.json @@ -0,0 +1,37 @@ +{ + "Incidents": "歷來事件", + "No data yet": "沒有資料", + "All systems not operational": "所有服務都已停止運作", + "All systems operational": "所有服務皆正常運作", + "Some systems not operational": "部分服務停止運作 ({{down}} / {{total}})", + "Last updated on": "最後更新於:{{date}}({{seconds}} 秒前)", + "upcoming maintenance": "{{count}} 個即將要進行的維護", + "upcoming maintenance_plural": "{{count}} 個即將要進行的維護", + "Hide": "[隱藏]", + "Show": "[顯示]", + "Operational": "運行中", + "No data available": "沒有資料,請確保已部署最新設定的 Worker 並檢查 Worker 狀態!", + "Overall": "總運行率:{{percent}}%", + "No Data": "沒有資料", + "percent at date": "{{percent}}% 於 {{date}}", + "Down for": "事件持續 {{duration}}(點擊查看詳情)", + "incidents at": "🚨 {{name}} 於 {{date}} 停運", + "Response times": "回應時間(毫秒)", + "Upcoming": "[即將開始] ", + "Scheduled Maintenance": "預定維護", + "Scheduled for": "預定開始:", + "From": "開始:", + "Expected end": "預計結束:", + "To": "結束:", + "Until further notice": "即日起持續生效", + "Affected components": "受影響的部份:", + "MONITOR ID NOT FOUND": "[錯誤:找不到站點 ID]", + "No incidents in this month": "本月無事件", + "There are no incidents for this month": "本月沒有任何事件發生。", + "Monitor not found": "找不到 ID 為 {{id}} 的站點!", + "Monitor State not defined": "站點狀態未定義,請檢查您的 Worker 狀態與 KV 綁定!", + "All": "全部", + "Select monitor": "選取站點", + "Backwards": "← 上個月", + "Forward": "下個月 →" +} diff --git a/pages/api/data.ts b/pages/api/data.ts index ffb41a4..797e05b 100644 --- a/pages/api/data.ts +++ b/pages/api/data.ts @@ -1,4 +1,4 @@ -import { workerConfig } from '@/uptime.config' +import { maintenances, workerConfig } from '@/uptime.config' import { NextRequest } from 'next/server' import { CompactedMonitorStateWrapper, getFromStore } from '@/worker/src/store' @@ -45,7 +45,8 @@ export default async function handler(req: NextRequest): Promise { up: compactedState.data.overallUp, down: compactedState.data.overallDown, updatedAt: compactedState.data.lastUpdate, - monitors: monitors, + monitors, + maintenances, } return new Response(JSON.stringify(ret), { diff --git a/util/i18n.ts b/util/i18n.ts index f3ffbb3..ff7f85a 100644 --- a/util/i18n.ts +++ b/util/i18n.ts @@ -3,6 +3,7 @@ import { initReactI18next } from 'react-i18next' import LanguageDetector from 'i18next-browser-languagedetector' import en from '../locales/en/common.json' import zhCN from '../locales/zh-CN/common.json' +import zhTW from '../locales/zh-TW/common.json' i18n .use(LanguageDetector) @@ -12,6 +13,7 @@ i18n en: { common: en }, 'zh-CN': { common: zhCN }, zh: { common: zhCN }, + 'zh-TW': { common: zhTW }, }, fallbackLng: 'en', interpolation: {