From 2bfcda96f4bf8633e9a8b61216641c775b759f71 Mon Sep 17 00:00:00 2001 From: ridersaying Date: Tue, 24 Nov 2026 20:14:25 +0800 Subject: [PATCH] feat(frontend): add a follow-system theme mode (#7026) The theme had three settings, light, dark and ultra dark, so anyone whose desktop switches appearance on a schedule had to change the panel by hand. Add a System step to the theme button on the sidebar, the login page, the command palette and the subscription page. In that mode the panel follows the OS light/dark setting and repaints when it changes, without a reload. The stored preference moves to theme-mode; the legacy dark-mode boolean is still read on first load and still written, so existing users keep their theme. --- .../command-palette/CommandPalette.tsx | 31 ++--- frontend/src/hooks/useTheme.tsx | 118 ++++++++++++++-- frontend/src/layouts/AppSidebar.tsx | 45 ++++--- frontend/src/pages/login/LoginPage.tsx | 39 +++--- frontend/src/pages/sub/SubHeader.tsx | 37 +++-- frontend/src/test/storybook-theme.test.tsx | 12 +- frontend/src/test/theme-system.test.tsx | 126 ++++++++++++++++++ internal/web/translation/ar-EG.json | 6 +- internal/web/translation/en-US.json | 6 +- internal/web/translation/es-ES.json | 6 +- internal/web/translation/fa-IR.json | 6 +- internal/web/translation/id-ID.json | 6 +- internal/web/translation/ja-JP.json | 6 +- internal/web/translation/pt-BR.json | 6 +- internal/web/translation/ru-RU.json | 6 +- internal/web/translation/sk-SK.json | 6 +- internal/web/translation/tr-TR.json | 6 +- internal/web/translation/uk-UA.json | 6 +- internal/web/translation/vi-VN.json | 6 +- internal/web/translation/zh-CN.json | 6 +- internal/web/translation/zh-TW.json | 6 +- 21 files changed, 384 insertions(+), 108 deletions(-) create mode 100644 frontend/src/test/theme-system.test.tsx diff --git a/frontend/src/components/command-palette/CommandPalette.tsx b/frontend/src/components/command-palette/CommandPalette.tsx index ca8505520..5bf820c10 100644 --- a/frontend/src/components/command-palette/CommandPalette.tsx +++ b/frontend/src/components/command-palette/CommandPalette.tsx @@ -14,6 +14,7 @@ import { CopyOutlined, DashboardOutlined, DatabaseOutlined, + DesktopOutlined, DiscordOutlined, ExportOutlined, FileTextOutlined, @@ -36,7 +37,7 @@ import { ClipboardManager, HttpUtil, SizeFormatter } from '@/utils'; import { activateOnKey } from '@/utils/a11y'; import { useInboundOptions } from '@/api/queries/useInboundOptions'; import { useAllSettings } from '@/api/queries/useAllSettings'; -import { useTheme } from '@/hooks/useTheme'; +import { themeModeKey, useTheme } from '@/hooks/useTheme'; import { PANEL_ROUTES } from '@/routes/panelRoutes'; import type { ClientRecord, InboundOption } from '@/schemas/client'; import { commandPaletteStore, useCommandPalette } from './useCommandPalette'; @@ -90,7 +91,7 @@ export default function CommandPalette() { const { t } = useTranslation(); const [messageApi, messageContextHolder] = message.useMessage(); const navigate = useNavigate(); - const { isDark, isUltra, toggleTheme, toggleUltra, antdThemeConfig } = useTheme(); + const { mode, isDark, isUltra, cycleTheme: advanceTheme, antdThemeConfig } = useTheme(); const { isOpen, close } = useCommandPalette(); const { allSetting } = useAllSettings(); const { data: inbounds = [] } = useInboundOptions(); @@ -240,17 +241,9 @@ export default function CommandPalette() { }, [close, messageApi, t]); const cycleTheme = useCallback(() => { - if (!isDark) { - toggleTheme(); - if (isUltra) toggleUltra(); - } else if (!isUltra) { - toggleUltra(); - } else { - toggleUltra(); - toggleTheme(); - } + advanceTheme(); close(); - }, [isDark, isUltra, toggleTheme, toggleUltra, close]); + }, [advanceTheme, close]); const trimmedQuery = query.trim(); const isDebouncing = isOpen && trimmedQuery.length > 0 && trimmedQuery !== debouncedQuery; @@ -551,9 +544,16 @@ export default function CommandPalette() { id: 'act-cycle-theme', category: 'actions', title: t('menu.theme'), - subtitle: isUltra ? 'Ultra Dark' : isDark ? 'Dark' : 'Light', - keywords: ['theme', 'light', 'dark', 'ultra'], - icon: isDark ? : , + subtitle: t(themeModeKey(mode, isUltra)), + keywords: ['theme', 'light', 'dark', 'ultra', 'system', 'auto'], + icon: + mode === 'system' ? ( + + ) : isDark ? ( + + ) : ( + + ), action: cycleTheme, }, { @@ -589,6 +589,7 @@ export default function CommandPalette() { query, clientSearch, inbounds, + mode, isDark, isUltra, allSetting.subURI, diff --git a/frontend/src/hooks/useTheme.tsx b/frontend/src/hooks/useTheme.tsx index d55b5ab0a..ae645979e 100644 --- a/frontend/src/hooks/useTheme.tsx +++ b/frontend/src/hooks/useTheme.tsx @@ -1,10 +1,24 @@ -import { createContext, useCallback, useContext, useLayoutEffect, useMemo, useState } from 'react'; +import { + createContext, + useCallback, + useContext, + useLayoutEffect, + useMemo, + useState, + useSyncExternalStore, +} from 'react'; import type { ReactNode } from 'react'; import { theme as antdTheme } from 'antd'; import type { ThemeConfig } from 'antd'; +export type ThemeMode = 'light' | 'dark' | 'system'; + +const STORAGE_MODE = 'theme-mode'; +// Written alongside `theme-mode` because older panel builds and third-party +// scripts still read the boolean. const STORAGE_DARK = 'dark-mode'; const STORAGE_ULTRA = 'isUltraDarkThemeEnabled'; +const SCHEME_QUERY = '(prefers-color-scheme: dark)'; function readBool(key: string, fallback: boolean): boolean { const raw = localStorage.getItem(key); @@ -12,6 +26,62 @@ function readBool(key: string, fallback: boolean): boolean { return raw === 'true'; } +function systemPrefersDark(): boolean { + try { + return window.matchMedia(SCHEME_QUERY).matches; + } catch { + return false; + } +} + +function subscribeSystemScheme(onChange: () => void): () => void { + const mql = window.matchMedia(SCHEME_QUERY); + mql.addEventListener('change', onChange); + return () => mql.removeEventListener('change', onChange); +} + +/** Reads a stored preference, falling back to the legacy boolean panels wrote. */ +function parseStoredMode(raw: string | null, legacyDark: boolean): ThemeMode { + if (raw === 'light' || raw === 'dark' || raw === 'system') return raw; + return legacyDark ? 'dark' : 'light'; +} + +function readMode(): ThemeMode { + try { + return parseStoredMode(localStorage.getItem(STORAGE_MODE), readBool(STORAGE_DARK, true)); + } catch { + return 'dark'; + } +} + +function readUltra(): boolean { + try { + return readBool(STORAGE_ULTRA, false); + } catch { + return false; + } +} + +function resolveDark(mode: ThemeMode, systemDark: boolean): boolean { + return mode === 'system' ? systemDark : mode === 'dark'; +} + +/** Ultra dark rides on dark, so leaving system always lands on light. */ +function nextTheme(mode: ThemeMode, isUltra: boolean): { mode: ThemeMode; ultra: boolean } { + if (mode === 'light') return { mode: 'dark', ultra: false }; + if (mode === 'dark') { + return isUltra ? { mode: 'system', ultra: false } : { mode: 'dark', ultra: true }; + } + return { mode: 'light', ultra: false }; +} + +/** i18n key naming the current mode, used for the toggle's label and tooltip. */ +export function themeModeKey(mode: ThemeMode, isUltra: boolean): string { + if (mode === 'system') return 'menu.themeSystem'; + if (mode === 'light') return 'menu.themeLight'; + return isUltra ? 'menu.themeUltraDark' : 'menu.themeDark'; +} + function applyDom(isDark: boolean, isUltra: boolean) { document.body.classList.remove('dark', 'light'); document.body.classList.add(isDark ? 'dark' : 'light'); @@ -30,9 +100,10 @@ function applyDom(isDark: boolean, isUltra: boolean) { } // module load so the document is in the right theme before React mounts. -const initialDark = readBool(STORAGE_DARK, true); -const initialUltra = readBool(STORAGE_ULTRA, false); -applyDom(initialDark, initialUltra); +const initialMode = readMode(); +const initialUltra = readUltra(); +const initialDark = resolveDark(initialMode, systemPrefersDark()); +applyDom(initialDark, initialUltra && initialDark); const DARK_TOKENS = { colorBgBase: '#1a1b1f', @@ -151,33 +222,54 @@ export function pauseAnimationsUntilLeave(elementId: string): void { } interface ThemeContextValue { + /** The stored preference: light, dark, or follow the OS. */ + mode: ThemeMode; + /** Resolved appearance — `system` collapsed against the OS scheme. */ isDark: boolean; + /** Ultra dark is a variant of dark and never applies to light. */ isUltra: boolean; - toggleTheme: () => void; - toggleUltra: () => void; + /** Walks light → dark → ultra dark → system → light. */ + cycleTheme: () => void; antdThemeConfig: ThemeConfig; } const ThemeContext = createContext(null); export function ThemeProvider({ children }: { children: ReactNode }) { - const [isDark, setIsDark] = useState(initialDark); - const [isUltra, setIsUltra] = useState(initialUltra); + // Read at mount so a preference written by another tab or a test is honoured. + const [mode, setModeState] = useState(readMode); + const [ultraRequested, setUltraRequested] = useState(readUltra); + // Tracks the OS scheme live so `system` mode follows the user flipping their + // desktop appearance without a reload. + const systemDark = useSyncExternalStore(subscribeSystemScheme, systemPrefersDark, () => false); + + const isDark = resolveDark(mode, systemDark); + const isUltra = ultraRequested && isDark; useLayoutEffect(() => { applyDom(isDark, isUltra); + localStorage.setItem(STORAGE_MODE, mode); localStorage.setItem(STORAGE_DARK, String(isDark)); localStorage.setItem(STORAGE_ULTRA, String(isUltra)); - }, [isDark, isUltra]); + }, [mode, isDark, isUltra]); - const toggleTheme = useCallback(() => setIsDark((v) => !v), []); - const toggleUltra = useCallback(() => setIsUltra((v) => !v), []); + const cycleTheme = useCallback(() => { + const next = nextTheme(mode, isUltra); + setModeState(next.mode); + setUltraRequested(next.ultra); + }, [mode, isUltra]); const antdThemeConfig = useMemo(() => buildAntdThemeConfig(isDark, isUltra), [isDark, isUltra]); const value = useMemo( - () => ({ isDark, isUltra, toggleTheme, toggleUltra, antdThemeConfig }), - [isDark, isUltra, toggleTheme, toggleUltra, antdThemeConfig], + () => ({ + mode, + isDark, + isUltra, + cycleTheme, + antdThemeConfig, + }), + [mode, isDark, isUltra, cycleTheme, antdThemeConfig], ); return {children}; diff --git a/frontend/src/layouts/AppSidebar.tsx b/frontend/src/layouts/AppSidebar.tsx index e86cc260d..d440cc30e 100644 --- a/frontend/src/layouts/AppSidebar.tsx +++ b/frontend/src/layouts/AppSidebar.tsx @@ -11,6 +11,7 @@ import { ClusterOutlined, CodeOutlined, DatabaseOutlined, + DesktopOutlined, DiscordOutlined, GithubOutlined, HeartOutlined, @@ -31,7 +32,8 @@ import { import { HttpUtil } from '@/utils'; import { formatPanelVersion } from '@/lib/panel-version'; -import { pauseAnimationsUntilLeave, useTheme } from '@/hooks/useTheme'; +import { pauseAnimationsUntilLeave, themeModeKey, useTheme } from '@/hooks/useTheme'; +import type { ThemeMode } from '@/hooks/useTheme'; import { useAllSettings } from '@/api/queries/useAllSettings'; import { useCommandPalette } from '@/components/command-palette/useCommandPalette'; import { PANEL_ROUTES } from '@/routes/panelRoutes'; @@ -100,24 +102,29 @@ function VersionBadge({ version, collapsed }: { version: string; collapsed?: boo function ThemeCycleButton({ id, + mode, isDark, isUltra, onCycle, ariaLabel, }: { id: string; + mode: ThemeMode; isDark: boolean; isUltra: boolean; onCycle: () => void; ariaLabel: string; }) { - const icon = !isDark ? ( - - ) : !isUltra ? ( - - ) : ( - - ); + const icon = + mode === 'system' ? ( + + ) : !isDark ? ( + + ) : !isUltra ? ( + + ) : ( + + ); return ( ; + const { cycleTheme } = useTheme(); + return ; } afterEach(() => { document.body.className = ''; document.documentElement.removeAttribute('data-theme'); document.documentElement.style.colorScheme = ''; + // The provider seeds itself from storage at mount, so a toggle in one test + // would otherwise be inherited by the next. + localStorage.clear(); }); // Without color-scheme the browser paints native scrollbars light inside dark // modals, e.g. the Edit Client body. test('native scrollbars follow the panel theme', () => { + localStorage.setItem('theme-mode', 'light'); const { getByRole } = render( , ); - expect(document.documentElement.style.colorScheme).toBe('dark'); + expect(document.documentElement.style.colorScheme).toBe('light'); fireEvent.click(getByRole('button')); - expect(document.documentElement.style.colorScheme).toBe('light'); + expect(document.documentElement.style.colorScheme).toBe('dark'); }); test('native scrollbars follow the Storybook theme', () => { diff --git a/frontend/src/test/theme-system.test.tsx b/frontend/src/test/theme-system.test.tsx new file mode 100644 index 000000000..b5094c879 --- /dev/null +++ b/frontend/src/test/theme-system.test.tsx @@ -0,0 +1,126 @@ +import { act, fireEvent, render } from '@testing-library/react'; +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; + +import { ThemeProvider, useTheme } from '@/hooks/useTheme'; + +// `system` must survive two things nothing else exercises: the OS flipping its +// scheme while the tab stays open, and the legacy `dark-mode` boolean. + +type SchemeListener = (event: { matches: boolean }) => void; + +let systemDark = true; +let listeners: SchemeListener[] = []; + +function installMatchMedia() { + window.matchMedia = ((query: string) => ({ + matches: query.includes('prefers-color-scheme') ? systemDark : false, + media: query, + onchange: null, + addListener: () => {}, + removeListener: () => {}, + addEventListener: (_type: string, listener: SchemeListener) => { + listeners.push(listener); + }, + removeEventListener: (_type: string, listener: SchemeListener) => { + listeners = listeners.filter((l) => l !== listener); + }, + dispatchEvent: () => false, + })) as unknown as typeof window.matchMedia; +} + +function flipSystemScheme(dark: boolean) { + systemDark = dark; + act(() => { + listeners.forEach((listener) => listener({ matches: dark })); + }); +} + +function Harness() { + const { mode, isDark, isUltra, cycleTheme } = useTheme(); + return ( +
+ {mode} + {String(isDark)} + {String(isUltra)} + +
+ ); +} + +function renderHarness() { + const utils = render( + + + , + ); + return { + ...utils, + mode: () => utils.getByTestId('mode').textContent, + dark: () => utils.getByTestId('dark').textContent, + ultra: () => utils.getByTestId('ultra').textContent, + }; +} + +beforeEach(() => { + systemDark = true; + listeners = []; + installMatchMedia(); + localStorage.clear(); +}); + +afterEach(() => { + document.body.className = ''; + document.documentElement.style.colorScheme = ''; + document.documentElement.removeAttribute('data-theme'); +}); + +describe('theme mode', () => { + it('honours the legacy dark-mode boolean when theme-mode was never written', () => { + localStorage.setItem('dark-mode', 'false'); + + const ui = renderHarness(); + + expect(ui.mode()).toBe('light'); + expect(document.body.classList.contains('light')).toBe(true); + }); + + it('follows the OS scheme in system mode', () => { + localStorage.setItem('theme-mode', 'system'); + const ui = renderHarness(); + + expect(ui.mode()).toBe('system'); + expect(ui.dark()).toBe('true'); + expect(document.body.classList.contains('dark')).toBe(true); + + flipSystemScheme(false); + + expect(ui.dark()).toBe('false'); + expect(document.body.classList.contains('light')).toBe(true); + expect(document.documentElement.style.colorScheme).toBe('light'); + }); + + it('keeps an explicit mode pinned when the OS scheme changes', () => { + const ui = renderHarness(); + expect(ui.mode()).toBe('dark'); + + flipSystemScheme(false); + + expect(ui.mode()).toBe('dark'); + expect(ui.dark()).toBe('true'); + expect(document.body.classList.contains('dark')).toBe(true); + }); + + it('cycles light → dark → ultra dark → system → light', () => { + const ui = renderHarness(); + const seen: string[] = []; + + for (let i = 0; i < 4; i += 1) { + fireEvent.click(ui.getByText('cycle')); + seen.push(`${ui.mode()}:${ui.ultra()}`); + } + + expect(seen).toEqual(['dark:true', 'system:false', 'light:false', 'dark:false']); + }); +}); diff --git a/internal/web/translation/ar-EG.json b/internal/web/translation/ar-EG.json index 0ca119013..2036f8f32 100644 --- a/internal/web/translation/ar-EG.json +++ b/internal/web/translation/ar-EG.json @@ -128,7 +128,11 @@ "openMenu": "فتح القائمة", "pinSidebar": "تثبيت الشريط الجانبي", "unpinSidebar": "إلغاء تثبيت الشريط الجانبي", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "فاتح", + "themeDark": "داكن", + "themeUltraDark": "داكن فائق", + "themeSystem": "النظام" }, "pages": { "login": { diff --git a/internal/web/translation/en-US.json b/internal/web/translation/en-US.json index 579cb0cc1..678c20b49 100644 --- a/internal/web/translation/en-US.json +++ b/internal/web/translation/en-US.json @@ -128,7 +128,11 @@ "openMenu": "Open menu", "pinSidebar": "Pin sidebar", "unpinSidebar": "Unpin sidebar", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "Light", + "themeDark": "Dark", + "themeUltraDark": "Ultra Dark", + "themeSystem": "System" }, "pages": { "login": { diff --git a/internal/web/translation/es-ES.json b/internal/web/translation/es-ES.json index 0c3d41291..76b5e24fd 100644 --- a/internal/web/translation/es-ES.json +++ b/internal/web/translation/es-ES.json @@ -128,7 +128,11 @@ "openMenu": "Abrir menú", "pinSidebar": "Fijar barra lateral", "unpinSidebar": "Desfijar barra lateral", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "Claro", + "themeDark": "Oscuro", + "themeUltraDark": "Ultra oscuro", + "themeSystem": "Sistema" }, "pages": { "login": { diff --git a/internal/web/translation/fa-IR.json b/internal/web/translation/fa-IR.json index c310b72e1..885c43043 100644 --- a/internal/web/translation/fa-IR.json +++ b/internal/web/translation/fa-IR.json @@ -128,7 +128,11 @@ "openMenu": "باز کردن منو", "pinSidebar": "ثابت کردن نوار کناری", "unpinSidebar": "برداشتن تثبیت نوار کناری", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "روشن", + "themeDark": "تیره", + "themeUltraDark": "تیره فوق‌العاده", + "themeSystem": "سیستم" }, "pages": { "login": { diff --git a/internal/web/translation/id-ID.json b/internal/web/translation/id-ID.json index 916ca3d15..109d4bb5d 100644 --- a/internal/web/translation/id-ID.json +++ b/internal/web/translation/id-ID.json @@ -128,7 +128,11 @@ "openMenu": "Buka menu", "pinSidebar": "Sematkan bilah sisi", "unpinSidebar": "Lepas sematan bilah sisi", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "Terang", + "themeDark": "Gelap", + "themeUltraDark": "Gelap Ultra", + "themeSystem": "Sistem" }, "pages": { "login": { diff --git a/internal/web/translation/ja-JP.json b/internal/web/translation/ja-JP.json index c295c4940..0534b1c17 100644 --- a/internal/web/translation/ja-JP.json +++ b/internal/web/translation/ja-JP.json @@ -128,7 +128,11 @@ "openMenu": "メニューを開く", "pinSidebar": "サイドバーを固定", "unpinSidebar": "サイドバーの固定を解除", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "ライト", + "themeDark": "ダーク", + "themeUltraDark": "ウルトラダーク", + "themeSystem": "システム" }, "pages": { "login": { diff --git a/internal/web/translation/pt-BR.json b/internal/web/translation/pt-BR.json index a80d672a7..8d5e68319 100644 --- a/internal/web/translation/pt-BR.json +++ b/internal/web/translation/pt-BR.json @@ -128,7 +128,11 @@ "openMenu": "Abrir menu", "pinSidebar": "Fixar barra lateral", "unpinSidebar": "Desafixar barra lateral", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "Claro", + "themeDark": "Escuro", + "themeUltraDark": "Ultra escuro", + "themeSystem": "Sistema" }, "pages": { "login": { diff --git a/internal/web/translation/ru-RU.json b/internal/web/translation/ru-RU.json index c1cea6397..893570dab 100644 --- a/internal/web/translation/ru-RU.json +++ b/internal/web/translation/ru-RU.json @@ -128,7 +128,11 @@ "openMenu": "Открыть меню", "pinSidebar": "Закрепить боковую панель", "unpinSidebar": "Открепить боковую панель", - "subFormats": "Форматы подписки" + "subFormats": "Форматы подписки", + "themeLight": "Светлая", + "themeDark": "Тёмная", + "themeUltraDark": "Ультратёмная", + "themeSystem": "Системная" }, "pages": { "login": { diff --git a/internal/web/translation/sk-SK.json b/internal/web/translation/sk-SK.json index ff8bfa89e..9247be491 100644 --- a/internal/web/translation/sk-SK.json +++ b/internal/web/translation/sk-SK.json @@ -128,7 +128,11 @@ "openMenu": "Otvoriť menu", "pinSidebar": "Pripnúť bočné menu", "unpinSidebar": "Odopnúť bočné menu", - "subFormats": "Formáty odberu" + "subFormats": "Formáty odberu", + "themeLight": "Svetlá", + "themeDark": "Tmavá", + "themeUltraDark": "Ultra tmavá", + "themeSystem": "Systém" }, "pages": { "login": { diff --git a/internal/web/translation/tr-TR.json b/internal/web/translation/tr-TR.json index 21fa5d97d..f8d9a504f 100644 --- a/internal/web/translation/tr-TR.json +++ b/internal/web/translation/tr-TR.json @@ -128,7 +128,11 @@ "openMenu": "Menüyü aç", "pinSidebar": "Kenar çubuğunu sabitle", "unpinSidebar": "Kenar çubuğu sabitlemesini kaldır", - "subFormats": "Abonelik Formatları" + "subFormats": "Abonelik Formatları", + "themeLight": "Açık", + "themeDark": "Koyu", + "themeUltraDark": "Ultra koyu", + "themeSystem": "Sistem" }, "pages": { "login": { diff --git a/internal/web/translation/uk-UA.json b/internal/web/translation/uk-UA.json index c49937c02..146daa82a 100644 --- a/internal/web/translation/uk-UA.json +++ b/internal/web/translation/uk-UA.json @@ -128,7 +128,11 @@ "openMenu": "Відкрити меню", "pinSidebar": "Закріпити бічну панель", "unpinSidebar": "Відкріпити бічну панель", - "subFormats": "Формати підписки" + "subFormats": "Формати підписки", + "themeLight": "Світла", + "themeDark": "Темна", + "themeUltraDark": "Ультратемна", + "themeSystem": "Системна" }, "pages": { "login": { diff --git a/internal/web/translation/vi-VN.json b/internal/web/translation/vi-VN.json index 42fcebafd..3a339bf80 100644 --- a/internal/web/translation/vi-VN.json +++ b/internal/web/translation/vi-VN.json @@ -128,7 +128,11 @@ "openMenu": "Mở menu", "pinSidebar": "Ghim thanh bên", "unpinSidebar": "Bỏ ghim thanh bên", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "Sáng", + "themeDark": "Tối", + "themeUltraDark": "Siêu tối", + "themeSystem": "Hệ thống" }, "pages": { "login": { diff --git a/internal/web/translation/zh-CN.json b/internal/web/translation/zh-CN.json index 7a5e0c15c..aef65688f 100644 --- a/internal/web/translation/zh-CN.json +++ b/internal/web/translation/zh-CN.json @@ -128,7 +128,11 @@ "openMenu": "打开菜单", "pinSidebar": "固定侧边栏", "unpinSidebar": "取消固定侧边栏", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "浅色", + "themeDark": "深色", + "themeUltraDark": "极致深色", + "themeSystem": "跟随系统" }, "pages": { "login": { diff --git a/internal/web/translation/zh-TW.json b/internal/web/translation/zh-TW.json index f50598777..23ed88c0d 100644 --- a/internal/web/translation/zh-TW.json +++ b/internal/web/translation/zh-TW.json @@ -128,7 +128,11 @@ "openMenu": "開啟選單", "pinSidebar": "固定側邊欄", "unpinSidebar": "取消固定側邊欄", - "subFormats": "Sub Formats" + "subFormats": "Sub Formats", + "themeLight": "淺色", + "themeDark": "深色", + "themeUltraDark": "極致深色", + "themeSystem": "跟隨系統" }, "pages": { "login": {