From 3b5cc68d4ad16e47eea8a5e71b12b7f6c111033d Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Wed, 31 Dec 2025 19:25:28 +0800 Subject: [PATCH 1/2] feat: add Traditional Chinese zh-TW (#169) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add zh-TW * fix: zh-TW 用語修正 --- locales/zh-TW/common.json | 37 +++++++++++++++++++++++++++++++++++++ util/i18n.ts | 2 ++ 2 files changed, 39 insertions(+) create mode 100644 locales/zh-TW/common.json 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/util/i18n.ts b/util/i18n.ts index d3ed910..837d039 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: { From 5878fff4ba1d6f6f68d1035b2a0f63c181f6195c Mon Sep 17 00:00:00 2001 From: Bennet Gallein Date: Thu, 1 Jan 2026 13:45:02 +0100 Subject: [PATCH 2/2] fix: add maintenances to API response (#171) --- pages/api/data.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/api/data.ts b/pages/api/data.ts index fd7fe1e..8746b40 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 { MonitorState } from '@/types/config' import { NextRequest } from 'next/server' @@ -39,7 +39,8 @@ export default async function handler(req: NextRequest): Promise { up: state.overallUp, down: state.overallDown, updatedAt: state.lastUpdate, - monitors: monitors, + monitors, + maintenances, } return new Response(JSON.stringify(ret), {