fix(themes): reuse the key that was already written for this failure

f8e2a59 added `OpenInFileManagerFailed` in all three locales for exactly
this case and then only wired its sibling, so the key sat dead — clippy
was reporting it as never constructed. The follow-up fix invented a second
key rather than using it.

Now the notification reads "Could not open /…/themes", naming the path
instead of a category, and `ThemeFolderFailed` is gone. Clippy's
never-constructed list is back to what it is on main.
This commit is contained in:
l0ng-ai
2026-08-08 06:55:36 +08:00
parent b608fcaae9
commit 2a0b910cd4
5 changed files with 9 additions and 5 deletions
+9 -1
View File
@@ -1448,7 +1448,15 @@ impl Tty7App {
// file manager just opens nothing.
if let Err(e) = std::fs::create_dir_all(&dir) {
log::warn!("could not create {}: {e}", dir.display());
crate::ui::host_ops::HostOps::notify_err(window, cx, t(L10nKey::ThemeFolderFailed), &e);
crate::ui::host_ops::HostOps::notify_err(
window,
cx,
&t_fmt(
L10nKey::OpenInFileManagerFailed,
&[("path", &dir.display().to_string())],
),
&e,
);
return;
}
cx.open_with_system(&dir);
-1
View File
@@ -147,7 +147,6 @@ pub fn translate_en(key: L10nKey) -> &'static str {
L10nKey::SettingsAnsiColors => "ANSI colors",
L10nKey::SettingsCustomThemes => "Custom themes",
L10nKey::SettingsThemesRejected => "Not loaded from the themes folder",
L10nKey::ThemeFolderFailed => "Could not open the themes folder",
L10nKey::ThemeDuplicateFailed => "Could not duplicate the theme",
L10nKey::ThemeSaveFailed => "Could not save the theme",
L10nKey::OpenInFileManagerFailed => "Could not open {path}",
-1
View File
@@ -149,7 +149,6 @@ pub fn translate_ja(key: L10nKey) -> Option<&'static str> {
L10nKey::SettingsAnsiColors => "ANSI カラー",
L10nKey::SettingsCustomThemes => "カスタムテーマ",
L10nKey::SettingsThemesRejected => "テーマフォルダから読み込めなかったもの",
L10nKey::ThemeFolderFailed => "テーマフォルダを開けませんでした",
L10nKey::ThemeDuplicateFailed => "テーマを複製できませんでした",
L10nKey::ThemeSaveFailed => "テーマを保存できませんでした",
L10nKey::OpenInFileManagerFailed => "{path} を開けませんでした",
-1
View File
@@ -191,7 +191,6 @@ l10n_keys! {
SettingsCustomThemes,
SettingsThemesRejected,
ThemeDuplicateFailed,
ThemeFolderFailed,
ThemeSaveFailed,
OpenInFileManagerFailed,
SettingsCustomThemesIntro,
-1
View File
@@ -131,7 +131,6 @@ pub fn translate_zh(key: L10nKey) -> Option<&'static str> {
L10nKey::SettingsAnsiColors => "ANSI 颜色",
L10nKey::SettingsCustomThemes => "自定义主题",
L10nKey::SettingsThemesRejected => "主题文件夹里这些没能加载",
L10nKey::ThemeFolderFailed => "无法打开主题文件夹",
L10nKey::ThemeDuplicateFailed => "无法复制主题",
L10nKey::ThemeSaveFailed => "无法保存主题",
L10nKey::OpenInFileManagerFailed => "无法打开 {path}",