feat(i18n): replace visual mode with more languages

Use one text catalog across the 3.0 launcher, rooms and shared controls. Add Traditional Chinese, Japanese and Korean, expose them through the third language control, and remove the separate visual-mode state and rendering paths. Preserve ordinary icons, illustrations and motion.
This commit is contained in:
AAA committed 2026-11-14 10:40:23 -04:00
1 parent ca8e69f526
commit 64e6281eae
128 files changed
+6492 -1571

No files matched your search

@@ -1,25 +1,25 @@
import { useId } from "react";
import { Btn, Chip } from "../../components/living/primitives";
import { useCopy } from "../../ui/copy";
import { useCopy, type Copy } from "../../ui/copy";
import type { InterfaceLayout } from "../../lib/room-preferences";
import "./channel-interface-control.css";
const interfaceOptions = (zh: boolean) => [
{ value: "workspace", label: zh ? "完整工作区" : "Full workspace",
description: zh ? "房间、聊天和分享,一处掌握。" : "Rooms, chat and sharing together." },
{ value: "quick", label: zh ? "极简分享" : "Simple sharing",
description: zh ? "把画面放在中心,随时开始分享。" : "Keep the picture central, ready to share." },
const interfaceOptions = (t: Copy["t"]) => [
{ value: "workspace", label: t("channel.interfaceControl.fullWorkspace"),
description: t("channel.interfaceControl.workspaceDescription") },
{ value: "quick", label: t("channel.interfaceControl.simpleSharing"),
description: t("channel.interfaceControl.quickDescription") },
] as const;
/** Presentation only; the caller owns whether this choice is saved or previewed. */
export function ChannelInterfaceControl({ value, onChange }: {
value: InterfaceLayout; onChange(value: InterfaceLayout): void;
}) {
const { lang } = useCopy(), zh = lang === "zh";
const { t } = useCopy();
return <label className="c3-interface-choice">
<span>{zh ? "界面" : "Interface"}</span>
<span>{t("channel.interfaceControl.interface")}</span>
<select className="lr-select" value={value} onChange={event => onChange(event.target.value as InterfaceLayout)}>
{interfaceOptions(zh).map(option => <option key={option.value} value={option.value}>{option.label}</option>)}
{interfaceOptions(t).map(option => <option key={option.value} value={option.value}>{option.label}</option>)}
</select>
</label>;
}
@@ -28,20 +28,20 @@ export function ChannelInterfaceControl({ value, onChange }: {
export function ChannelInterfaceSuggestion({ value, onChange, onDismiss }: {
value: InterfaceLayout; onChange(value: InterfaceLayout): void; onDismiss(): void;
}) {
const { lang } = useCopy(), zh = lang === "zh";
const { t } = useCopy();
const headingId = useId();
return <section className="c3-interface-suggestion" aria-labelledby={headingId}>
<h3 id={headingId}>{zh ? "选择适合你的界面" : "Choose your view"}</h3>
<h3 id={headingId}>{t("channel.interfaceControl.chooseYourView")}</h3>
<div className="c3-interface-options" role="group" aria-labelledby={headingId}>
{interfaceOptions(zh).map(option => <Chip key={option.value} selected={value === option.value}
{interfaceOptions(t).map(option => <Chip key={option.value} selected={value === option.value}
title={`${option.label}: ${option.description}`} onClick={() => onChange(option.value)}>
<span className="c3-interface-option-label">{option.label}{option.value === "workspace" && <small>{zh ? "默认" : "Default"}</small>}</span>
<span className="c3-interface-option-label">{option.label}{option.value === "workspace" && <small>{t("channel.interfaceControl.default")}</small>}</span>
<span className="c3-interface-option-description">{option.description}</span>
</Chip>)}
</div>
<footer><Btn icon="arrowRight" size="dense" quiet title={{ text: zh ? "跳过" : "Skip" }}
cap={{ text: zh ? "跳过" : "Skip" }} onClick={onDismiss} />
<span>{zh ? "以后可在“更多选项 → 界面”中修改。" : "Change this later in More options → Interface."}</span>
<footer><Btn icon="arrowRight" size="dense" quiet title={{ text: t("channel.interfaceControl.skip") }}
cap={{ text: t("channel.interfaceControl.skip") }} onClick={onDismiss} />
<span>{t("channel.interfaceControl.changeLater")}</span>
</footer>
</section>;
}