Skip to content

Improve Chinese localization and display adaptation - #843

Closed
haoze-evolluling wants to merge 1 commit into
moudey:mainfrom
haoze-evolluling:main
Closed

haoze-evolluling wants to merge 1 commit into
moudey:mainfrom
haoze-evolluling:main

Conversation

@haoze-evolluling

Copy link
Copy Markdown

Overview

This PR improves the Chinese localization experience for Nilesoft Shell while strictly preserving existing code structures, features, and UI styling.

Summary of Changes

1. Language Files & NSS Configurations (imports/lang/)

  • Simplified Chinese (zh-CN.nss):
    • Localized folder navigation in goto.nss (Desktop, Downloads, Pictures, Documents, Startmenu, Profile, AppData, Temp, Applications, System32).
    • Localized taskbar manager menu in askbar.nss (Config, Manager, Directory, Version, Documentation, Donate).
    • Added localized extension input prompt (请输入扩展名) and administrator terminal run hint.
    • Aligned Settings and Windows Defender item names with current Windows standard Chinese terminology.
  • Traditional Chinese (zh-TW.nss):
    • Synchronized new keys with idiomatic Traditional Chinese terms and fixed an existing typo (windows_defender was previously set to "Windows Update").
  • Baseline Fallback Keys (�n.nss):
    • Provided baseline English fallback values for all new keys to guarantee 100% backward compatibility for other language translations.

2. Locale Matching & Fallback (shell.nss)

  • Added locale alias files (zh.nss, zh-SG.nss -> zh-CN.nss; zh-HK.nss, zh-MO.nss -> zh-TW.nss).
  • Enhanced shell.nss to use a two-tier fallback: exact sys.lang match -> base language name (sys.lang.name) -> �n.nss.

3. Submenu Grouping Fix (imports/modify.nss)

  • Fixed hardcoded English strings (menu="Pin/Unpin", menu="file manage", menu="Terminal") by referencing dynamic localization variables (menu=loc.pin_unpin, menu=loc.file_manage, menu=title.terminal).
  • Added system IDs and Chinese matching patterns (取消固定, 固定, 在终端中打开) so context menu items are properly grouped into submenus on Chinese Windows environments.

4. Manager UI & Resource Localization (shell.exe & Shell.rc)

  • Enabled #pragma code_page(65001) (UTF-8) in Shell.rc and added LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED String Table and Dialog resources (IDD_INPUTBOX, IDD_CMDLINE).
  • Updated shell.exe (Main.cpp) to dynamically load localized button labels and command-line help from resource strings with transparent English fallbacks.
  • Improved control font initialization in Control.h and Main.cpp using SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, ...) to dynamically use the native system UI font (Microsoft YaHei UI on Chinese systems, Segoe UI on English systems) with ClearType for crisp text rendering.

- Complete Chinese translations for goto navigation, taskbar menus, file manage, and tooltips
- Add baseline fallback keys in en.nss for backward compatibility
- Fix submenu grouping in modify.nss for localized environments
- Add locale alias support (zh, zh-SG, zh-HK, zh-MO) and two-tier fallback in shell.nss
- Add Chinese resource strings and dialogs in Shell.rc
- Add dynamic localized text loading and system UI font adaptation in shell.exe
Abdullah-Masood-05 added a commit to Abdullah-Masood-05/Shell that referenced this pull request Oct 16, 2026
zh-TW had windows_defender="Windows Update"; it is "Windows 安全性".
ko had taskbar_Settings as "Task Manager settings"; it is "작업 표시줄 설정".
The zh-TW fix comes from upstream PR moudey#843 (haoze-evolluling).
Abdullah-Masood-05 added a commit to Abdullah-Masood-05/Shell that referenced this pull request Oct 16, 2026
The Pin/Unpin, File manage and Terminal moves named their target menus with
literal English text (menu="Pin/Unpin", "file manage", "Terminal"), but those
menus are titled loc.pin_unpin, loc.file_manage and title.terminal. With any
non-English language file the path no longer matched, so the moved items
(Windows' Copy as path, Customize this folder, Open PowerShell window here,
the pin/unpin items) disappeared. menu= is evaluated as an expression and
compared, case-insensitively, with the menu's normalized title, so the rules
now use the same expressions as the titles.

Pin/unpin items are matched by id instead of find="pin*"/"unpin*", which only
worked with English item names.

shell.dll: a menu= path is normalized like menu titles ('&' accelerators and
trailing dots dropped), so menu=loc.develop ("&Develop") or a translated title
with an accelerator finds its menu too.

Upstream issue moudey#477 and PR moudey#843 (haoze-evolluling).
Abdullah-Masood-05 added a commit to Abdullah-Masood-05/Shell that referenced this pull request Oct 16, 2026
Only zh-TW and zh-CN had a language file, so zh-HK, zh-MO, zh-SG and plain zh
got English. Next to the Norwegian rule: Hong Kong, Macao and zh-Hant-* load
zh-TW.nss; every other zh-* (zh-SG, zh-Hans-*, zh) loads zh-CN.nss. The block
that shell -config:init adds to an older shell.nss is kept the same.

From upstream PR moudey#843 (haoze-evolluling), as a mapping instead of alias files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant