MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / localizeError

Function localizeError

deployments/desktop/static/app.js:221–249  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

219}
220
221function localizeError(message) {
222 const text = String(message || "");
223 const replacements = [
224 ["Request failed:", "请求失败:"],
225 ["Not found", "未找到资源"],
226 ["Invalid path", "路径无效"],
227 ["Invalid JSON body:", "JSON 请求体无效:"],
228 ["JSON body must be an object", "JSON 请求体必须是对象"],
229 ["user_id is required", "请输入用户 ID"],
230 ["role_name is required", "请输入角色名"],
231 ["action must be create, switch, or delete", "动作必须是创建、切换或删除"],
232 ["user_id and push_id are required", "缺少用户 ID 或推送 ID"],
233 ["item_type must be author, institution, or keyword", "规则类型必须是作者、机构或关键词"],
234 ["action must be add or remove", "动作必须是添加或移除"],
235 ["value is required", "请输入规则内容"],
236 ["arxiv_id is required", "请输入 arXiv ID 或链接"],
237 ["kind must be 'llm' or 'embedding'", "测试类型必须是 llm 或 embedding"],
238 ["Profile not found:", "未找到画像:"],
239 ["Push not found:", "未找到推送:"],
240 ["Could not fetch arXiv paper:", "无法获取 arXiv 论文:"],
241 ["PDF not found:", "未找到 PDF:"],
242 ];
243 for (const [source, target] of replacements) {
244 if (text.includes(source)) {
245 return text.replace(source, target);
246 }
247 }
248 return text;
249}
250
251function setStatus(text, busy = false) {
252 $("statusText").textContent = busy ? `${text}...` : text;

Callers 4

apiFunction · 0.85
scheduleDailyTaskPollingFunction · 0.85
runActionFunction · 0.85
app.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected