feat(i18n): 外观页 40 条文案进词表(M180 I18NAPPEAR)
- 卡片内 22 处硬编码英文(整窗/面板透明度、背景图开关+路径、填充、暗化、配色来源)全部改走 Key
- 运行时诊断改成 key + 参数:`background::Note`(读盘/解码/过大/小图平铺)、`state::backend_note`、
`palette::note` 全部返回 Key;`state.rs` 只留 key、不放文案表(390 → 391 行)
- 上限/下限常量走占位符 `{floor}` / `{max}` / `{limit}` / `{requested}`;`{:.2}` 在 Rust 侧格式化好
再套模板(`Catalog::render` 只认 `{name}`)
- 新增 40 条 key(中英各一条),按装配链锚点插在 `SettingsAppearanceCornerSuspended` 之后,
金表 `golden/tail.rs` 同位置插入 40 行(`rows() == len() == Key::ALL.len()`)
- 守卫三条:中文渲染全非 ASCII、卡片 key 全覆盖(改回写死英文即红)、外观 key 逐条真翻过
- probe 加第二条取证路(`record_rendered`),`take()` 签名不动(M179 的守卫在 scope 外)
This commit is contained in:
1 parent
65e7ccc3bf
commit
c4c3c15285
14 files changed
+858
-184
No files matched your search
@@ -17,6 +17,7 @@
|
||||
//! 变成一条**可读诊断**而不是一个 `unwrap`。
|
||||
|
||||
use unlucky_design::color::{Scheme, SchemeFlavor};
|
||||
use unlucky_i18n::catalog::Key;
|
||||
use unlucky_presenter::prefs::{
|
||||
AppearanceBase, AppearancePrefs, BgFill, PaletteSource, WindowCorner,
|
||||
};
|
||||
@@ -24,7 +25,7 @@ use unlucky_presenter::prefs::{
|
||||
use crate::Backend;
|
||||
|
||||
use super::alpha::{self, effective_glass, effective_panel_alpha, panel_is_forced_opaque};
|
||||
use super::background::{self, Image};
|
||||
use super::background::{self, Image, Note};
|
||||
use super::palette::{self, Resolved, Source};
|
||||
|
||||
/// 取证开关的环境变量名(截图矩阵与真机日志用;生产默认全部不设)。
|
||||
@@ -67,8 +68,8 @@ pub struct State {
|
||||
pub selected_group: usize,
|
||||
/// 已解码的背景图(`None` = 没设 / 读失败)。
|
||||
image: Option<Image>,
|
||||
/// 读盘/解码失败的**可读诊断**(按发生顺序追加)。
|
||||
diagnostics: Vec<String>,
|
||||
/// 读盘/解码失败的**可读诊断**(按发生顺序追加;`Note` = key + 参数,句子在词表里)。
|
||||
diagnostics: Vec<Note>,
|
||||
/// 上一次的配色解析结果。
|
||||
resolved: Option<Resolved>,
|
||||
/// 当前深浅(配色解析的输入)。
|
||||
@@ -196,24 +197,24 @@ impl State {
|
||||
Some(&resolved.scheme)
|
||||
}
|
||||
|
||||
/// 读盘/解码失败的诊断(设置页逐条显示)。
|
||||
/// 读盘/解码失败的诊断(设置页逐条显示;一条 = 一条 key + 它的参数)。
|
||||
#[must_use]
|
||||
pub fn diagnostics(&self) -> &[String] {
|
||||
pub fn diagnostics(&self) -> &[Note] {
|
||||
&self.diagnostics
|
||||
}
|
||||
|
||||
/// CPU 档降级的说明(`None` = 没有降级)。
|
||||
/// CPU 档降级的说明 key(`None` = 没有降级)。
|
||||
///
|
||||
/// M180:返回 key 而不是英文句子——本文件已 390 行、贴着 400 行硬线,**不放文案表**。
|
||||
#[must_use]
|
||||
pub fn backend_note(&self) -> Option<&'static str> {
|
||||
self.panel_is_forced().then_some(
|
||||
"Software renderer: panel transparency and glass stay fully opaque (window \
|
||||
transparency still works).",
|
||||
)
|
||||
pub fn backend_note(&self) -> Option<Key> {
|
||||
self.panel_is_forced()
|
||||
.then_some(Key::SettingsAppearanceSoftwareRendererNote)
|
||||
}
|
||||
|
||||
/// 配色来源的提示(`None` = 一级成功)。
|
||||
/// 配色来源的提示 key(`None` = 一级成功)。
|
||||
#[must_use]
|
||||
pub fn palette_note(&self) -> Option<&'static str> {
|
||||
pub fn palette_note(&self) -> Option<Key> {
|
||||
self.resolved.as_ref()?.note()
|
||||
}
|
||||
|
||||
@@ -362,7 +363,7 @@ impl State {
|
||||
}
|
||||
match background::load(trimmed) {
|
||||
Ok(image) => self.image = Some(image),
|
||||
Err(error) => self.diagnostics.push(error.describe()),
|
||||
Err(error) => self.diagnostics.push(error.note()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user