Language Selection SubMenu
The submenu locates on the Preference Menu Dropdown.
The model UserService is from its parent component.
Load the language preference on application start.
Note
Keep language resource on each UI componenets.
Layout
- Language Selection SubMenu
- English Radio CheckBox
- Simlified Chinese Radio CheckBox
- Traditional Chinese Radio CheckBox
Source Code Path
See this page for git repository.
WPF Application Source Code Path
- MainWindow (In the preference menu)
Web Page Application Source Code Path
HiNC-2025-webservice (Quasar CLI SPA):
wwwroot-src/src/layouts/AppMenuBar.vue— nestedPreference → Language ▸dropdown with English / 简体中文 / 繁體中文 radio items. The selected code is persisted viaappState.setLanguageCode(code).wwwroot-src/src/stores/appState.ts—languageCodestate +setLanguageCode(code)action; hydrated on layout mount byloadServerPreferences().wwwroot-src/src/api/preference.ts— typed wrapper overGET/POST /api/preference/language.Environments/PreferenceController.cs— REST endpoints:GET /api/preference/language→{ languageCode };POSTvalidates against["en", "zh-Hans", "zh-Hant"]and writes throughUserService.SaveUserConfig()→UserConfig.LanguageCode.
Note
The rendered text does not yet flip when the language is changed — the preference is persisted but UI text localisation (via vue-i18n + translation bundles) is deferred. The confirmation toast informs the user of this intentionally.