mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-16 17:12:25 +08:00
feat(nofxi): full i18n bilingual support (zh/en)
Agent i18n: - All command responses bilingual (help, status, positions, balance, trades, analysis, settings, errors) - Language auto-detected from web UI lang toggle - Stored per-user in SQLite preferences - AI chat system prompt switches to Chinese/English based on user lang - Trade confirmation prompts bilingual Web UI: - Sends lang parameter with every API request - Agent extracts [lang:xx] prefix and persists preference i18n message catalog: nofxi/internal/agent/i18n.go
This commit is contained in:
@@ -337,7 +337,7 @@ async function send(text){
|
||||
addM('user',text);
|
||||
typEl.classList.add('on');sBtnEl.disabled=true;inpEl.focus();
|
||||
try{
|
||||
const r=await fetch(API+'/api/chat',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({message:text,user_id:1})});
|
||||
const r=await fetch(API+'/api/chat',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({message:text,user_id:1,lang:lang})});
|
||||
const d=await r.json();
|
||||
addM('bot',d.response||d.error||'No response');
|
||||
}catch(e){addM('bot','⚠️ Error: '+e.message)}
|
||||
|
||||
Reference in New Issue
Block a user