Feature: add a language reset button and fit toolbar labels

The entry dialog showed the external language-pack folder with no way to
disable it. Reset now clears the LangDir configuration value and restores a
built-in language; it does not read, move or delete any file on disk. The
current language is kept when already built-in (zh_CN/zh_TW/en_US); an
external pack falls back to en_US. Startup treats a missing LangDir as ./lang
and an explicitly empty one as built-ins only; scanner, loader, encoding check
and the zh_CN patch skip disk access when the directory is empty.

The button is created at runtime, sized from the localized label (German
"Zuruecksetzen" fits) and matching OK/Cancel height; the folder field shrinks.
Reset and the result message are translated in en_US, zh_TW and de_DE.

Toolbar buttons share one width taken from the longest label. At the 1400-px
startup window en_US used 76px per button and zh_TW 85px, clipping the last
icons; zh_CN was 72px and de_DE 64px. Shortening the longest en_US/zh_TW labels
brings both to 64px, so all 19 icons fit.

Verified with a Debug x64 build: resetting a German pack leaves de_DE.ini on
disk while settings become LangDir= and Language=en_US; a built-in zh_TW UI
stays zh_TW; after restart with LangDir empty, only 3 built-ins are listed.
English and zh_TW screenshots show all 19 toolbar buttons at startup.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-12-01 20:52:49 +01:00
1 parent 1d03cbeb3f
commit 3d2dd08be5
6 files changed
+226 -102

No files matched your search

+2
View File
@@ -2350,3 +2350,5 @@ MCP
服务模式:显示累计运行时长;有崩溃记录时显示 MTBF 与失败率。=Dienstmodus: zeigt die kumulierte Laufzeit; bei Abstuerzen MTBF und Fehlerrate.
授权到期信息:=Lizenzablauf:
\n剩余天数包含到期当天;已过期时主控功能可能受限。=\nDie verbleibenden Tage schliessen den Ablauftag ein; nach Ablauf koennen Funktionen eingeschraenkt sein.
重置=Zuruecksetzen
已清空语言包目录设置,已恢复内置语言,重启程序后生效。=Sprachpaketordner-Einstellung geleert; integrierte Sprache wiederhergestellt. Neustart des Programms erforderlich.