多语言,EQ 频响曲线 Y 轴可调,滤波器类型新增 Bypass
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -8,11 +8,14 @@ import localeKo from "./data-ko.json";
|
||||
import localeVi from "./data-vi.json";
|
||||
import localePt from "./data-pt.json";
|
||||
import localePl from "./data-pl.json";
|
||||
import localeRu from "./data-ru.json";
|
||||
import localeJa from "./data-ja.json";
|
||||
|
||||
/**
|
||||
* 语言索引映射:
|
||||
* 0=en, 1=zh-HK, 2=zh-CN → 设备固件支持,选择后会下发 dev/info.cgi?action=setting&language=
|
||||
* 3=de, 4=es, 5=fr, 6=ko, 7=vi, 8=pt, 9=pl → 设备不支持,仅在 controller 前端做界面语言切换,绝不下发设备
|
||||
* 3=de, 4=es, 5=fr, 6=ko, 7=vi, 8=pt, 9=pl,
|
||||
* 10=ru, 11=ja → 设备不支持,仅在 controller 前端做界面语言切换,绝不下发设备
|
||||
*/
|
||||
export const DEFAULT_DEVICE_LANGUAGE = 0;
|
||||
|
||||
@@ -32,6 +35,8 @@ const LOCALE_PACKS = [
|
||||
localeVi,
|
||||
localePt,
|
||||
localePl,
|
||||
localeRu,
|
||||
localeJa,
|
||||
] as LocalePack[];
|
||||
|
||||
/** 语言选择器可展示的全部语言数量(含仅前端语言)。 */
|
||||
@@ -39,7 +44,7 @@ export const LANGUAGE_COUNT = LOCALE_PACKS.length;
|
||||
|
||||
/**
|
||||
* 语言选择器固定显示的「母语名称」,与当前界面语言无关。
|
||||
* 数组下标即语言索引(0=en … 9=pl),选择时直接作为语言值使用。
|
||||
* 数组下标即语言索引(0=en … 11=ja),选择时直接作为语言值使用。
|
||||
*/
|
||||
export const LANGUAGE_NATIVE_LABELS = [
|
||||
"English",
|
||||
@@ -52,6 +57,8 @@ export const LANGUAGE_NATIVE_LABELS = [
|
||||
"Tiếng Việt",
|
||||
"Português (Portugal)",
|
||||
"Polski",
|
||||
"Русский",
|
||||
"日本語",
|
||||
];
|
||||
|
||||
/** 是否为设备支持的语言(0/1/2),只有这些才会下发设备。 */
|
||||
@@ -69,7 +76,7 @@ export function resolveDeviceLanguage(language: number | undefined): number {
|
||||
return language ?? DEFAULT_DEVICE_LANGUAGE;
|
||||
}
|
||||
|
||||
/* ── 前端语言覆盖(仅非设备语言 3..9,持久化到 localStorage,绝不下发设备) ── */
|
||||
/* ── 前端语言覆盖(仅非设备语言 3..11,持久化到 localStorage,绝不下发设备) ── */
|
||||
const UI_LANGUAGE_OVERRIDE_KEY = "luxsin.uiLanguageOverride";
|
||||
|
||||
function readStoredOverride(): number | null {
|
||||
@@ -91,7 +98,7 @@ export function getUiLanguageOverride(): number | null {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置前端语言覆盖。传入仅前端语言(3..9)时生效并持久化;
|
||||
* 设置前端语言覆盖。传入仅前端语言(3..11)时生效并持久化;
|
||||
* 传入设备语言(0/1/2)或 null 时清除覆盖,恢复跟随设备语言。
|
||||
*/
|
||||
export function setUiLanguageOverride(index: number | null): number | null {
|
||||
|
||||
Reference in New Issue
Block a user