Add lightweight i18n foundation; route new strings through catalogs
- Backend src/i18n.rs: embedded locales/<lang>.json, t(key,params) with {placeholder} interpolation, process-wide language from config.language (default it), English-then-key fallback. Applied to the identity reminder and name-lock/empty errors.
- Frontend: web/assets/locales/<lang>.json + t()/loadI18n()/applyI18n() (data-i18n attributes); language follows the browser; async bootstrap. Applied to the settings panel.
- Convention: new user-facing and model-facing strings use the catalog; wire/JSON/identifiers never translated. Existing strings migrate in a later round. it+en catalogs; 115 tests; verified live (catalog error messages) + node --check + HTTP. README documents the convention.
This commit is contained in:
1 parent
73b665d1a7
commit
498e3dbc1b
12 files changed
+248
-27
No files matched your search
+12
-12
@@ -73,30 +73,30 @@
|
||||
<div class="modal-card settings-card">
|
||||
<h2 id="settings-title">Impostazioni</h2>
|
||||
<div class="scope-toggle">
|
||||
<button id="set-scope-session" class="btn ghost active">Sessione</button>
|
||||
<button id="set-scope-general" class="btn ghost">Generali</button>
|
||||
<button id="set-scope-session" class="btn ghost active" data-i18n="settings.scope.session">Sessione</button>
|
||||
<button id="set-scope-general" class="btn ghost" data-i18n="settings.scope.general">Generali</button>
|
||||
</div>
|
||||
<p id="set-hint" class="muted"></p>
|
||||
<label class="field" id="set-name-field"><span>Nome</span>
|
||||
<label class="field" id="set-name-field"><span data-i18n="settings.name">Nome</span>
|
||||
<input id="set-name" type="text" autocomplete="off" />
|
||||
</label>
|
||||
<p id="set-name-hint" class="muted small"></p>
|
||||
<label class="field"><span>Note (scopo della chat)</span>
|
||||
<label class="field"><span data-i18n="settings.notes">Note (scopo della chat)</span>
|
||||
<textarea id="set-notes" rows="2"></textarea>
|
||||
</label>
|
||||
<label class="field"><span>System Prompt</span>
|
||||
<label class="field"><span data-i18n="settings.sp">System Prompt</span>
|
||||
<textarea id="set-sp" rows="4"></textarea>
|
||||
</label>
|
||||
<div class="field-grid">
|
||||
<label class="field"><span>Temperature</span><input id="set-temp" type="number" step="0.1" min="0" /></label>
|
||||
<label class="field"><span>Top-p</span><input id="set-topp" type="number" step="0.05" min="0" max="1" /></label>
|
||||
<label class="field"><span>Top-k</span><input id="set-topk" type="number" step="1" min="0" /></label>
|
||||
<label class="field"><span>Min-p</span><input id="set-minp" type="number" step="0.05" min="0" max="1" /></label>
|
||||
<label class="field"><span>Max token</span><input id="set-maxtokens" type="number" step="1" min="1" /></label>
|
||||
<label class="field"><span data-i18n="settings.temp">Temperature</span><input id="set-temp" type="number" step="0.1" min="0" /></label>
|
||||
<label class="field"><span data-i18n="settings.topp">Top-p</span><input id="set-topp" type="number" step="0.05" min="0" max="1" /></label>
|
||||
<label class="field"><span data-i18n="settings.topk">Top-k</span><input id="set-topk" type="number" step="1" min="0" /></label>
|
||||
<label class="field"><span data-i18n="settings.minp">Min-p</span><input id="set-minp" type="number" step="0.05" min="0" max="1" /></label>
|
||||
<label class="field"><span data-i18n="settings.maxtokens">Max token</span><input id="set-maxtokens" type="number" step="1" min="1" /></label>
|
||||
</div>
|
||||
<div class="dialog-actions">
|
||||
<button id="set-cancel" class="btn">Annulla</button>
|
||||
<button id="set-save" class="btn primary">Salva</button>
|
||||
<button id="set-cancel" class="btn" data-i18n="settings.cancel">Annulla</button>
|
||||
<button id="set-save" class="btn primary" data-i18n="settings.save">Salva</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user