This commit is contained in:
2026-09-09 18:06:21 +08:00
parent 161af68fe3
commit 45b9f9ed5d
79 changed files with 1167 additions and 1532 deletions
@@ -88,28 +88,18 @@
<h1 id="language-selection-submenu">Language Selection SubMenu</h1>
<p>The submenu locates on the <a class="xref" href="preference-menu.html">Preference Menu Dropdown</a>. It is the only
place either client offers for changing the interface language. What that choice sets in motion in
the web client — the message bundles, the locale applied before the first frame, the single switch
place the application offers for changing the interface language. What that choice sets in motion —
the message bundles, the locale applied before the first frame, the single switch
function and everything that re-renders behind it — is
<a class="xref" href="../platform/i18n.html">Internationalization</a>; this page covers the gesture.</p>
<p>The web submenu's model is the application-state store rather than a service handed down by the
<p>The submenu's model is the application-state store rather than a service handed down by the
parent component: it reads the current code and the available-code list from that store and calls
the store's language action. Both values are hydrated by the store's server-preferences load, which
the shell layout runs on mount — a separate path from the one that decides which locale the first
painted frame uses. The WPF client resolves its language manager during start-up, and the manager
reads the persisted code out of the user configuration as it is constructed.</p>
painted frame uses.</p>
<h2 id="layout">Layout</h2>
<p>The two clients draw the submenu differently.</p>
<ul>
<li><p>Language Selection SubMenu — WPF application</p>
<ul>
<li>English RadioButton</li>
<li>Simplified Chinese RadioButton</li>
<li>Traditional Chinese RadioButton</li>
</ul>
<p>Three fixed rows in one radio group, ticked at start-up to match the current language.</p>
</li>
<li><p>Language Selection SubMenu — web application</p>
<li><p>Language Selection SubMenu</p>
<ul>
<li>Language Row — one plain row per code in the store's available-code list, so the rows are
whatever the server reports rather than a fixed set of three. Each carries the language's own
@@ -120,13 +110,11 @@ the active state. No row carries a radio button or a checkbox.</li>
<p>The parent entry captions the current language, so it reads without opening the submenu.</p>
</li>
</ul>
<p>Choosing a row in the web client closes the popup and makes one call, the store's language action.
<p>Choosing a row closes the popup and makes one call, the store's language action.
The store writes the new code optimistically, POSTs it, adopts the current and available lists the
server echoes back, and only then switches the live catalogue — so the interface text flips after
the server has accepted the value, and the confirmation toast already reads in the language just
picked. A rejected write rolls the store back and changes no interface text at all. In the WPF
client picking a radio swaps the merged string dictionary in place and saves the code to the user
configuration, and the labels follow without a restart.</p>
picked. A rejected write rolls the store back and changes no interface text at all.</p>
<h2 id="source-code-path">Source Code Path</h2>
<p>See <a class="xref" href="../index.html">HiNC App Anatomy</a> for git repository links.</p>
<h3 id="web-application">Web Application</h3>