feat(app-iced): M114 账户页三轨登录(微软正版 / 第三方皮肤站 / 本地档案)
- 账户页:当前账户卡 + 全部账户列表 + 空态三入口 + 皮肤区;五项动作(添加/切换/删除/重新登录/校验) - 三轨添加流程:设备码(用户码+链接+倒计时+过期重试+取消)、授权码(浏览器+可复制链接+取消)、 本地档案(名字校验)、第三方站(服务地址 + 服务发现校验 + 密码登录,密码掩码且用完即弃) - 导航:账户为一等页,入口是轨底头像位(未登录=描边剪影 / 已登录=首字母块+名字;窄高收成图标条) - 凭据红线:DTO 侧形状脱敏 + 状态层二次脱敏 + 密码掩码;Inject-JWT 测试断言视图模型干净(已做变异取证) - presenter:authlib 登录/服务发现/皮肤抓取(复用下载引擎的 HTTP 客户端,无新增依赖)、 皮肤原图经 DTO 到 UI 裁剪成头像(既有 image 依赖,未改 Cargo.toml) - i18n:新增 account 域 51 条中英文案(离线档案口径全量写入),金表同步
This commit is contained in:
1 parent
e7b04c4afe
commit
1ff00bbe50
43 files changed
+4343
-117
No files matched your search
@@ -113,6 +113,7 @@ macro_rules! finish {
|
||||
}
|
||||
|
||||
mod agent;
|
||||
mod account;
|
||||
mod content;
|
||||
mod core_text;
|
||||
mod download;
|
||||
@@ -132,6 +133,7 @@ mod golden;
|
||||
mod tests;
|
||||
|
||||
use agent::agent_entries;
|
||||
use account::account_entries;
|
||||
use content::content_entries;
|
||||
use core_text::core_text_entries;
|
||||
use download::{download_entries, version_entries};
|
||||
@@ -172,6 +174,9 @@ nav_entries! {
|
||||
// M109:内容库页。与 M107 同一条纪律——本域排在 main 已占住的链尾**之后**,
|
||||
// 于是 `Key::ALL` 顺序 = 金表顺序 = 先 main 的全部域,再 version,最后 content。
|
||||
content_entries,
|
||||
// M114:账户页。同理**追加在 main 已占住的链尾之后**(先 content 再 account),
|
||||
// 金表只追加不重排。
|
||||
account_entries,
|
||||
finish,
|
||||
{}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
//! 账户页文案(M114 三轨:微软正版 / 第三方皮肤站 / 本地档案)。
|
||||
//!
|
||||
//! 域文件的形状见 [`crate::catalog`] 的「域装配」一节。本域**追加在装配链末尾**,
|
||||
//! 所以金表(`catalog::golden`)里这批 key 也排在最后。
|
||||
//!
|
||||
//! ## 口径(不许改写成别的说法)
|
||||
//!
|
||||
//! 本地档案的说明必须带「仅本地/隔离网络测试用,无法连接启用正版验证的服务器」——
|
||||
//! 这是 README 已定的口径(`AccountTrackOfflineBody` / `AccountOfflineWarning` 两处都写全),
|
||||
//! 不许写成「兼容旧启动器迁移」这种暗示能进正版服的说法。
|
||||
//!
|
||||
//! 文案里**没有任何 token 字样**:账户页从不展示凭据(M114 审核红线),
|
||||
//! 「密码只用于这一次登录」这条提示是唯一提到密码的地方。
|
||||
|
||||
macro_rules! account_entries {
|
||||
($next:ident, $($rest:ident,)* { $($acc:tt)* }) => {
|
||||
$next! { $($rest,)* {
|
||||
$($acc)*
|
||||
// ── 页头 / 列表
|
||||
AccountTitle => ("Accounts", "账户"),
|
||||
AccountSubtitle => ("Microsoft, third-party skin servers and local profiles", "微软正版、第三方皮肤站与本地档案"),
|
||||
AccountListTitle => ("All accounts", "全部账户"),
|
||||
AccountAddedOn => ("Added {date}", "添加于 {date}"),
|
||||
AccountActiveChip => ("Active", "当前"),
|
||||
AccountSwitch => ("Use for launch", "切换为启动账户"),
|
||||
AccountRelogin => ("Sign in again", "重新登录"),
|
||||
AccountRemove => ("Remove", "删除"),
|
||||
AccountKindMicrosoft => ("Microsoft", "微软正版"),
|
||||
AccountKindAuthlib => ("Third-party skin server", "第三方皮肤站"),
|
||||
AccountKindOffline => ("Local profile", "本地档案"),
|
||||
AccountServer => ("Server {server}", "服务器 {server}"),
|
||||
// ── 空态
|
||||
AccountEmptyTitle => ("No accounts yet", "还没有账户"),
|
||||
AccountEmptyBody => ("Add a Microsoft account, a third-party skin server account, or a local profile.", "添加微软正版账户、第三方皮肤站账户,或建一个本地档案。"),
|
||||
AccountEmptyAction => ("Add an account", "添加账户"),
|
||||
// ── 三条轨道的入口卡
|
||||
AccountTrackMicrosoftTitle => ("Microsoft account", "微软正版"),
|
||||
AccountTrackMicrosoftBody => ("Sign in with a device code or in your browser. Online servers require this kind of account.", "用设备码或浏览器登录。联机服务器必须用这种账户。"),
|
||||
AccountTrackAuthlibTitle => ("Third-party skin server", "第三方皮肤站"),
|
||||
AccountTrackAuthlibBody => ("An authlib-injector compatible server (LittleSkin and friends) brings its own skins and capes.", "兼容 authlib-injector 的皮肤站(如 LittleSkin)自带皮肤与披风。"),
|
||||
AccountTrackOfflineTitle => ("Local profile", "本地档案"),
|
||||
AccountTrackOfflineBody => ("Local / isolated-network testing only — it cannot join servers that require a genuine Minecraft account.", "仅本地/隔离网络测试用,无法连接启用正版验证的服务器。"),
|
||||
AccountTrackOpen => ("Sign in", "登录"),
|
||||
AccountTrackCreate => ("Create profile", "创建档案"),
|
||||
AccountDialogClose => ("Close", "关闭"),
|
||||
// ── 本地档案表单
|
||||
AccountOfflineNameLabel => ("Profile name", "档案名"),
|
||||
AccountOfflineNameHint => ("3–16 letters, digits or underscore", "3–16 位字母、数字或下划线"),
|
||||
AccountOfflineSubmit => ("Create profile", "创建档案"),
|
||||
AccountOfflineWarning => ("Local / isolated-network testing only — it cannot join servers that require a genuine Minecraft account.", "仅本地/隔离网络测试用,无法连接启用正版验证的服务器。"),
|
||||
// ── 微软登录面板(设备码 / 授权码)
|
||||
AccountDeviceCodeLabel => ("Enter this code", "输入这个用户码"),
|
||||
AccountDeviceCodeCopy => ("Copy code", "复制用户码"),
|
||||
AccountDeviceLinkCopy => ("Copy link", "复制链接"),
|
||||
AccountDeviceOpenLink => ("Open link", "打开链接"),
|
||||
AccountDeviceCountdown => ("{secs}s left", "剩 {secs}s"),
|
||||
AccountDeviceExpired => ("This code has expired. Start again for a fresh one.", "这个用户码已过期,重新开始换一个新的。"),
|
||||
AccountDeviceRetry => ("Try again", "重试"),
|
||||
AccountDeviceCancel => ("Cancel", "取消"),
|
||||
AccountDeviceBrowser => ("Sign in with browser", "用浏览器登录"),
|
||||
AccountDeviceUseCode => ("Use a device code instead", "改用设备码"),
|
||||
// ── 第三方站表单
|
||||
AccountServerLabel => ("Server address", "服务器地址"),
|
||||
AccountServerHint => ("API root, e.g. https://littleskin.cn/api/yggdrasil/", "API 根,例:https://littleskin.cn/api/yggdrasil/"),
|
||||
AccountServerProbe => ("Check server", "校验服务器"),
|
||||
AccountLoginNameLabel => ("Email or username", "邮箱或用户名"),
|
||||
AccountPasswordLabel => ("Password", "密码"),
|
||||
AccountPasswordHint => ("Used once for this sign-in. It is never stored.", "只在这次登录里用一次,不会保存。"),
|
||||
AccountAuthlibSubmit => ("Sign in", "登录"),
|
||||
AccountAuthlibIdleHint => ("Check the server address first; signing in only starts after the check passes.", "先校验服务器地址,通过之后才能登录。"),
|
||||
// ── 皮肤区
|
||||
AccountSkinTitle => ("Skin", "皮肤"),
|
||||
AccountSkinNone => ("No skin available", "没有可用皮肤"),
|
||||
AccountSkinHint => ("Skins come from the account's own server; nothing is generated locally.", "皮肤来自账户自己的服务器,本地不生成任何假皮肤。"),
|
||||
// ── 导航轨底部头像
|
||||
AccountRailSignedOut => ("Not signed in", "未登录"),
|
||||
AccountDeviceHint => ("Open the link in your browser and enter the code above.", "在浏览器里打开链接,输入上面的用户码。"),
|
||||
AccountDeviceBrowserHint => ("Finish the sign-in in the browser window we just opened; the link below also works.", "在我们刚打开的浏览器窗口里完成登录;下面的链接也能手动打开。"),
|
||||
AccountServerChecking => ("Checking the server…", "正在校验服务器…"),
|
||||
AccountServerOk => ("Server {server} is ready", "服务器 {server} 可用"),
|
||||
AccountLoginFailed => ("Sign-in failed", "登录失败"),
|
||||
AccountCurrentTitle => ("Current account", "当前账户"),
|
||||
} }
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) use account_entries;
|
||||
@@ -304,4 +304,61 @@ pub(super) const GOLDEN: &[(&str, &str, &str)] = &[
|
||||
("PackReasonSymlink", "symbolic link, skipped", "符号链接,已跳过"),
|
||||
("PackReasonUnsafePath", "path fails the pack path rules, skipped", "路径过不了包内规整,已跳过"),
|
||||
("PackReasonUnreadable", "cannot read it, skipped", "读不出来,已跳过"),
|
||||
// ── M114 账户页:追加在 main 的全部域之后(金表只追加不重排)
|
||||
("AccountTitle", "Accounts", "账户"),
|
||||
("AccountSubtitle", "Microsoft, third-party skin servers and local profiles", "微软正版、第三方皮肤站与本地档案"),
|
||||
("AccountListTitle", "All accounts", "全部账户"),
|
||||
("AccountAddedOn", "Added {date}", "添加于 {date}"),
|
||||
("AccountActiveChip", "Active", "当前"),
|
||||
("AccountSwitch", "Use for launch", "切换为启动账户"),
|
||||
("AccountRelogin", "Sign in again", "重新登录"),
|
||||
("AccountRemove", "Remove", "删除"),
|
||||
("AccountKindMicrosoft", "Microsoft", "微软正版"),
|
||||
("AccountKindAuthlib", "Third-party skin server", "第三方皮肤站"),
|
||||
("AccountKindOffline", "Local profile", "本地档案"),
|
||||
("AccountServer", "Server {server}", "服务器 {server}"),
|
||||
("AccountEmptyTitle", "No accounts yet", "还没有账户"),
|
||||
("AccountEmptyBody", "Add a Microsoft account, a third-party skin server account, or a local profile.", "添加微软正版账户、第三方皮肤站账户,或建一个本地档案。"),
|
||||
("AccountEmptyAction", "Add an account", "添加账户"),
|
||||
("AccountTrackMicrosoftTitle", "Microsoft account", "微软正版"),
|
||||
("AccountTrackMicrosoftBody", "Sign in with a device code or in your browser. Online servers require this kind of account.", "用设备码或浏览器登录。联机服务器必须用这种账户。"),
|
||||
("AccountTrackAuthlibTitle", "Third-party skin server", "第三方皮肤站"),
|
||||
("AccountTrackAuthlibBody", "An authlib-injector compatible server (LittleSkin and friends) brings its own skins and capes.", "兼容 authlib-injector 的皮肤站(如 LittleSkin)自带皮肤与披风。"),
|
||||
("AccountTrackOfflineTitle", "Local profile", "本地档案"),
|
||||
("AccountTrackOfflineBody", "Local / isolated-network testing only — it cannot join servers that require a genuine Minecraft account.", "仅本地/隔离网络测试用,无法连接启用正版验证的服务器。"),
|
||||
("AccountTrackOpen", "Sign in", "登录"),
|
||||
("AccountTrackCreate", "Create profile", "创建档案"),
|
||||
("AccountDialogClose", "Close", "关闭"),
|
||||
("AccountOfflineNameLabel", "Profile name", "档案名"),
|
||||
("AccountOfflineNameHint", "3–16 letters, digits or underscore", "3–16 位字母、数字或下划线"),
|
||||
("AccountOfflineSubmit", "Create profile", "创建档案"),
|
||||
("AccountOfflineWarning", "Local / isolated-network testing only — it cannot join servers that require a genuine Minecraft account.", "仅本地/隔离网络测试用,无法连接启用正版验证的服务器。"),
|
||||
("AccountDeviceCodeLabel", "Enter this code", "输入这个用户码"),
|
||||
("AccountDeviceCodeCopy", "Copy code", "复制用户码"),
|
||||
("AccountDeviceLinkCopy", "Copy link", "复制链接"),
|
||||
("AccountDeviceOpenLink", "Open link", "打开链接"),
|
||||
("AccountDeviceCountdown", "{secs}s left", "剩 {secs}s"),
|
||||
("AccountDeviceExpired", "This code has expired. Start again for a fresh one.", "这个用户码已过期,重新开始换一个新的。"),
|
||||
("AccountDeviceRetry", "Try again", "重试"),
|
||||
("AccountDeviceCancel", "Cancel", "取消"),
|
||||
("AccountDeviceBrowser", "Sign in with browser", "用浏览器登录"),
|
||||
("AccountDeviceUseCode", "Use a device code instead", "改用设备码"),
|
||||
("AccountServerLabel", "Server address", "服务器地址"),
|
||||
("AccountServerHint", "API root, e.g. https://littleskin.cn/api/yggdrasil/", "API 根,例:https://littleskin.cn/api/yggdrasil/"),
|
||||
("AccountServerProbe", "Check server", "校验服务器"),
|
||||
("AccountLoginNameLabel", "Email or username", "邮箱或用户名"),
|
||||
("AccountPasswordLabel", "Password", "密码"),
|
||||
("AccountPasswordHint", "Used once for this sign-in. It is never stored.", "只在这次登录里用一次,不会保存。"),
|
||||
("AccountAuthlibSubmit", "Sign in", "登录"),
|
||||
("AccountAuthlibIdleHint", "Check the server address first; signing in only starts after the check passes.", "先校验服务器地址,通过之后才能登录。"),
|
||||
("AccountSkinTitle", "Skin", "皮肤"),
|
||||
("AccountSkinNone", "No skin available", "没有可用皮肤"),
|
||||
("AccountSkinHint", "Skins come from the account's own server; nothing is generated locally.", "皮肤来自账户自己的服务器,本地不生成任何假皮肤。"),
|
||||
("AccountRailSignedOut", "Not signed in", "未登录"),
|
||||
("AccountDeviceHint", "Open the link in your browser and enter the code above.", "在浏览器里打开链接,输入上面的用户码。"),
|
||||
("AccountDeviceBrowserHint", "Finish the sign-in in the browser window we just opened; the link below also works.", "在我们刚打开的浏览器窗口里完成登录;下面的链接也能手动打开。"),
|
||||
("AccountServerChecking", "Checking the server…", "正在校验服务器…"),
|
||||
("AccountServerOk", "Server {server} is ready", "服务器 {server} 可用"),
|
||||
("AccountLoginFailed", "Sign-in failed", "登录失败"),
|
||||
("AccountCurrentTitle", "Current account", "当前账户"),
|
||||
];
|
||||
Reference in new issue
Block a user