Table of Contents

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 — nested Preference → Language ▸ dropdown with English / 简体中文 / 繁體中文 radio items. The selected code is persisted via appState.setLanguageCode(code).
  • wwwroot-src/src/stores/appState.tslanguageCode state + setLanguageCode(code) action; hydrated on layout mount by loadServerPreferences().
  • wwwroot-src/src/api/preference.ts — typed wrapper over GET/POST /api/preference/language.
  • Environments/PreferenceController.cs — REST endpoints: GET /api/preference/language{ languageCode }; POST validates against ["en", "zh-Hans", "zh-Hant"] and writes through UserService.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.