Файли
openidea/src/platform/updateSource.ts
T
Zou e1f25d2747 feat(i18n): add Traditional Chinese (zh-TW) UI language (#4950)
Adds 繁體中文 to the UI languages. The catalogs are converted from the Simplified ones with OpenCC (s2twp) plus a Taiwan IT terminology pass keyed on the English source (column → 欄, undo → 復原). zh-TW, zh-HK, zh-MO and zh-Hant* resolve to it; other zh tags stay Simplified. The update source picks CNB for every zh* locale, matching the backend.

Co-authored-by: g4cj8498741 <[email protected]>
2026-11-21 12:25:12 +08:00

13 рядки
633 B
TypeScript

import { resolveLocale } from "@/platform/i18n";
import type { UpdateSource } from "@/platform/ipc";
import { useProject } from "@/platform/project";
/** System Settings > Updates > Update source; `auto` picks the CNB mirror for the Chinese UI. */
export function updateSource(): UpdateSource {
const { settings } = useProject.getState();
const chosen = settings?.general?.updateSource;
if (chosen === "github" || chosen === "cnb") return chosen;
// Matches the backend's UpdateSource::resolve, which picks CNB for every `zh*` tag.
return resolveLocale(settings?.appearance?.locale).startsWith("zh") ? "cnb" : "github";
}