mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-14 06:43:16 +08:00
Ship Cursor-only MCP admin and modular Admin/Chat UI.
Plugins/Skills install and edit via mcpServers JSON, with clearer row actions, soft reloads, and instant loading placeholders; also drop MCP market and harden related scheduler/logging/exec guards. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2aff012b48
commit
f6f129931f
61 changed files with 18057 additions and 16327 deletions
24
interfaces/admin/static/js/chat/i18n/index.js
Normal file
24
interfaces/admin/static/js/chat/i18n/index.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import messagesZh from "./messages-zh.js";
|
||||
import messagesEn from "./messages-en.js";
|
||||
import { state } from "../state.js";
|
||||
|
||||
export const I18N = { zh: messagesZh, en: messagesEn };
|
||||
export const LANG_KEY = "ops_admin_lang";
|
||||
|
||||
export function t(key, vars) {
|
||||
let s = (I18N[state.currentLang] && I18N[state.currentLang][key]) || (I18N.en && I18N.en[key]) || key;
|
||||
if (vars && typeof s === "string") {
|
||||
for (const [k, v] of Object.entries(vars)) {
|
||||
s = s.replace(new RegExp(`\\{${k}\\}`, "g"), String(v));
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
export function applyI18nStatic() {
|
||||
document.documentElement.lang = state.currentLang === "zh" ? "zh-CN" : "en";
|
||||
document.querySelectorAll("[data-i18n]").forEach((node) => {
|
||||
const key = node.getAttribute("data-i18n");
|
||||
node.textContent = t(key);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue