feat: i18n support - auto-detect system language for zh/en prompts

This commit is contained in:
Liang Jiaqing
2026-04-16 18:47:40 +08:00
parent 47bcb1b01a
commit 7cadbd7403
7 changed files with 56 additions and 20 deletions

View File

@@ -171,7 +171,7 @@ _js_ime_fix = ("" if os.name == 'nt' else
"f();new MutationObserver(f).observe(d.body,{childList:1,subtree:1})}()")
_embed_html(f'<script>{_js_scroll_fix};{_js_ime_fix}</script>', height=0)
if prompt := st.chat_input("请输入指令"):
if prompt := st.chat_input("any task?"):
st.session_state.messages.append({"role": "user", "content": prompt})
if hasattr(agent, '_pet_req') and not prompt.startswith('/'): agent._pet_req('state=walk')
with st.chat_message("user"): st.markdown(prompt)