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
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