Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat(mobile): localize inline mobile copy through shared i18n catalogs (#603)

Dariusz Koryto11d589c57f47
diff --git a/apps/desktop/src/main/picgo.mjs b/apps/desktop/src/main/picgo.mjs
index f5aa13fe..3444b559 100644
--- a/apps/desktop/src/main/picgo.mjs
+++ b/apps/desktop/src/main/picgo.mjs
@@ -53,6 +53,7 @@ export const normalizePicGoServerKey = (value) => {
if (typeof value !== "string") throw new Error("PicGo server key is invalid");
const key = value.trim();
if (!key) return "";
+ // oxlint-disable-next-line no-control-regex -- rejects control characters and spaces in the PicGo server key
if (key.length > 512 || /[\u0000-\u0020\u007f]/.test(key)) throw new Error("PicGo server key is invalid");
return key;
};
diff --git a/apps/mobile/src/components/LocalTiptapEditor.tsx b/apps/mobile/src/components/LocalTiptapEditor.tsx
index 0cce813a..c8268673 100644
--- a/apps/mobile/src/components/LocalTiptapEditor.tsx
+++ b/apps/mobile/src/components/LocalTiptapEditor.tsx
@@ -72,6 +72,7 @@ import {
getMobileEditorInputAttributes,
getMobileEditorImageScaleLabel,
getMobileEditorImageWidthPresetLabel,
+ getMobileEditorCopy,
getMobileEditorPlaceholder,
getMobileEditorToolbarActionLabel,
getMobileEditorToolbarLabel,
@@ -501,9 +502,11 @@ const ReadOnlyX6Diagram = ({
};
}, [diagram, theme, locale]);
- const title = locale !== "zh-CN"
- ? diagram.kind === "mind-map" ? "Mind map" : diagram.kind === "architecture" ? "Architecture diagram" : "Flowchart"
- : diagram.kind === "mind-map" ? "思维导图" : diagram.kind === "architecture" ? "架构图" : "流程图";
+ const title = diagram.kind === "mind-map"
+ ? getMobileEditorCopy(locale).diagram.mindMap
+ : diagram.kind === "architecture"
+ ? getMobileEditorCopy(locale).diagram.architecture
+ : getMobileEditorCopy(locale).diagram.flowchart;
return (
<section className="edgeever-x6-document">
<div aria-label={title} className="edgeever-x6-diagram" key={diagram.kind} ref={containerRef} role="img" />
@@ -698,9 +701,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
parameterKind: "none",
resultMode: "both",
output: "",
- error: props.locale !== "zh-CN"
- ? "The selected prompt no longer exists. Choose another prompt."
- : "所选指令已不存在,请重新选择。",
+ error: getMobileEditorCopy(props.locale).ai.promptMissing,
};
}
return {
@@ -938,7 +939,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
insertImageUploadPlaceholder(
editor,
createMobileImageUploadPlaceholderSource(uploadIdValue),
- props.locale !== "zh-CN" ? "Uploading image…" : "图片上传中…",
+ getMobileEditorCopy(props.locale).image.uploading,
previewDataUrlValue,
pendingImageSelectionRef.current
);
@@ -988,7 +989,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
type: "paragraph",
content: [{
type: "text",
- text: `${props.locale !== "zh-CN" ? "Attachment: " : "附件:"}${filenameValue}`,
+ text: `${getMobileEditorCopy(props.locale).attachmentPrefix}${filenameValue}`,
marks: [{
type: "link",
attrs: {
@@ -1030,7 +1031,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
editor.view.dispatch(editor.state.tr.replaceWith(
range.from,
range.to,
- editor.schema.text(`${props.locale !== "zh-CN" ? "Attachment: " : "附件:"}${filenameValue}`, [linkMark])
+ editor.schema.text(`${getMobileEditorCopy(props.locale).attachmentPrefix}${filenameValue}`, [linkMark])
));
}, [editor, props.locale]);
@@ -1156,7 +1157,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
...current,
generating: false,
requestId: null,
- error: requestError instanceof Error ? requestError.message : (props.locale !== "zh-CN" ? "AI generation failed." : "AI 生成失败。"),
+ error: requestError instanceof Error ? requestError.message : getMobileEditorCopy(props.locale).ai.generationFailed,
} : current);
});
}, [aiPanel, props.locale]);
@@ -1196,9 +1197,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
if (!isAiSelectionSnapshotCurrent(aiPanel.selection, currentDocument, editor.state.doc.content.size)) {
setAiPanel((current) => current ? {
...current,
- error: props.locale !== "zh-CN"
- ? "The selection expired because the note changed. Select the text again."
- : "笔记内容已变化,选区已失效,请重新选择文本。",
+ error: getMobileEditorCopy(props.locale).ai.selectionExpired,
} : current);
return;
}
@@ -1740,7 +1739,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
))}
{onAiRequestRef.current ? (
<button
- aria-label={props.locale !== "zh-CN" ? "Use AI on the note or selected text" : "用 AI 处理正文或选中内容"}
+ aria-label={getMobileEditorCopy(props.locale).ai.openForNote}
className="edgeever-ai-toolbar-button"
onClick={requestOpenAiForSelection}
onMouseDown={(event) => event.preventDefault()}
@@ -1761,7 +1760,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
)}
{aiSelectionTrigger && !aiPanel ? (
<button
- aria-label={props.locale !== "zh-CN" ? "Use AI on selected text" : "用 AI 处理选中内容"}
+ aria-label={getMobileEditorCopy(props.locale).ai.openForSelection}
className="edgeever-ai-selection-trigger"
onClick={requestOpenAiForSelection}
onMouseDown={(event) => event.preventDefault()}
@@ -1775,14 +1774,14 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
) : null}
{aiSelectionHint ? (
<div aria-live="polite" className="edgeever-ai-selection-hint" role="status">
- {props.locale !== "zh-CN" ? "Add some note content first." : "请先输入正文内容。"}
+ {getMobileEditorCopy(props.locale).ai.emptyNote}
</div>
) : null}
{aiUndoFingerprint && !aiPanel ? (
<div aria-live="polite" className="edgeever-ai-undo" role="status">
- <span>{props.locale !== "zh-CN" ? "AI updated the selection." : "AI 已更新选中内容。"}</span>
+ <span>{getMobileEditorCopy(props.locale).ai.selectionUpdated}</span>
<button onClick={undoAiSelectionDraft} onMouseDown={(event) => event.preventDefault()} type="button">
- {props.locale !== "zh-CN" ? "Undo" : "撤销"}
+ {getMobileEditorCopy(props.locale).actions.undo}
</button>
</div>
) : null}
@@ -1838,41 +1837,10 @@ const MobileSelectionAiPanel = ({
panel: MobileAiPanelState;
prompts: AiPromptTemplate[];
}) => {
- const english = locale !== "zh-CN";
const [picker, setPicker] = useState<MobileAiPickerKind | null>(null);
- const actionLabels: Record<AiAction, string> = {
- summarize: english ? "Summarize" : "精简总结",
- "extract-key-points": english ? "Key points" : "提炼要点",
- "extract-todos": english ? "Extract tasks" : "提取待办",
- "rewrite-proofread": english ? "Rewrite & proofread" : "改写与校对",
- translate: english ? "Translate" : "全文翻译",
- "improve-writing": english ? "Polish" : "润色表达",
- "fix-spelling-grammar": english ? "Fix spelling & grammar" : "修正拼写与语法",
- "make-shorter": english ? "Make concise" : "精炼表达",
- "make-longer": english ? "Make longer" : "扩写内容",
- "simplify-language": english ? "Simplify language" : "简化表达",
- "change-tone": english ? "Change tone" : "调整语气",
- "continue-writing": english ? "Continue writing" : "继续写作",
- custom: english ? "Custom prompt" : "自定义指令",
- };
- const languageLabels: Record<AiTargetLanguage, string> = {
- en: english ? "English" : "英语",
- "zh-CN": english ? "Simplified Chinese" : "简体中文",
- "zh-TW": english ? "Traditional Chinese" : "繁体中文",
- ja: english ? "Japanese" : "日语",
- ko: english ? "Korean" : "韩语",
- es: english ? "Spanish" : "西班牙语",
- fr: english ? "French" : "法语",
- de: english ? "German" : "德语",
- pt: english ? "Portuguese" : "葡萄牙语",
- pl: english ? "Polish" : "波兰语",
- };
- const toneLabels: Record<AiTone, string> = {
- professional: english ? "Professional" : "专业",
- friendly: english ? "Friendly" : "友好",
- casual: english ? "Casual" : "轻松",
- direct: english ? "Direct" : "直接",
- };
+ const actionLabels: Record<AiAction, string> = getMobileEditorCopy(locale).ai.actions;
+ const languageLabels: Record<AiTargetLanguage, string> = getMobileEditorCopy(locale).ai.languages;
+ const toneLabels: Record<AiTone, string> = getMobileEditorCopy(locale).ai.tones;
const update = (next: Partial<MobileAiPanelState>) => onChange((current) => current ? { ...current, ...next } : current);
const generateDisabled = panel.generating || (!panel.promptId && panel.action === "custom" && !panel.customInstruction.trim());
const appendDisabled = panel.generating || !panel.output || panel.resultMode === "replace";
@@ -1956,10 +1924,10 @@ const MobileSelectionAiPanel = ({
: [];
const pickerTitle = picker === "action"
- ? (english ? "Choose an action" : "选择处理方式")
+ ? getMobileEditorCopy(locale).ai.chooseAction
: picker === "language"
- ? (english ? "Choose target language" : "选择目标语言")
- : (english ? "Choose tone" : "选择语气");
+ ? getMobileEditorCopy(locale).ai.chooseTargetLanguage
+ : getMobileEditorCopy(locale).ai.chooseTone;
const choosePickerOption = (value: string) => {
if (picker === "action") selectPromptOrAction(value);
@@ -1988,8 +1956,8 @@ const MobileSelectionAiPanel = ({
return (
<section
aria-label={panel.selection.wholeNote
- ? (english ? "AI whole-note assistant" : "AI 全文助手")
- : (english ? "AI selection assistant" : "AI 选区助手")}
+ ? getMobileEditorCopy(locale).ai.noteTitle
+ : getMobileEditorCopy(locale).ai.selectionTitle}
aria-modal="true"
className="edgeever-ai-panel"
role="dialog"
@@ -1997,19 +1965,19 @@ const MobileSelectionAiPanel = ({
<header className="edgeever-ai-panel-header">
<div>
<strong>{panel.selection.wholeNote
- ? (english ? "AI whole-note assistant" : "AI 全文助手")
- : (english ? "AI selection assistant" : "AI 选区助手")}</strong>
+ ? getMobileEditorCopy(locale).ai.noteTitle
+ : getMobileEditorCopy(locale).ai.selectionTitle}</strong>
<small>{panel.selection.wholeNote
- ? (english ? "No text selected; the whole note will be processed." : "未选择文字,将处理整篇正文。")
- : (english ? "Only the selected text will be processed." : "只处理当前选中的正文。")}</small>
+ ? getMobileEditorCopy(locale).ai.noteScopeHint
+ : getMobileEditorCopy(locale).ai.selectionScopeHint}</small>
</div>
- <button aria-label={english ? "Close" : "关闭"} onClick={onClose} type="button">×</button>
+ <button aria-label={getMobileEditorCopy(locale).close} onClick={onClose} type="button">×</button>
</header>
<div className="edgeever-ai-panel-body">
<MobileAiPickerField
disabled={panel.generating}
expanded={picker === "action"}
- label={english ? "Action" : "处理方式"}
+ label={getMobileEditorCopy(locale).ai.action}
onOpen={() => setPicker("action")}
value={selectedPrompt?.name ?? actionLabels[panel.action]}
/>
@@ -2017,7 +1985,7 @@ const MobileSelectionAiPanel = ({
<MobileAiPickerField
disabled={panel.generating}
expanded={picker === "language"}
- label={english ? "Target language" : "目标语言"}
+ label={getMobileEditorCopy(locale).ai.targetLanguage}
onOpen={() => setPicker("language")}
value={languageLabels[panel.targetLanguage]}
/>
@@ -2026,34 +1994,34 @@ const MobileSelectionAiPanel = ({
<MobileAiPickerField
disabled={panel.generating}
expanded={picker === "tone"}
- label={english ? "Tone" : "语气"}
+ label={getMobileEditorCopy(locale).ai.tone}
onOpen={() => setPicker("tone")}
value={toneLabels[panel.tone]}
/>
) : null}
{!panel.promptId && panel.action === "custom" ? (
<label>
- <span>{english ? "Tell AI what to do" : "告诉 AI 你想怎么处理"}</span>
+ <span>{getMobileEditorCopy(locale).ai.instruction}</span>
<textarea
disabled={panel.generating}
maxLength={2000}
onChange={(event) => update({ customInstruction: event.target.value })}
- placeholder={english ? "For example: Rewrite this as a concise email." : "例如:改写成一封简洁的邮件。"}
+ placeholder={getMobileEditorCopy(locale).ai.instructionPlaceholder}
rows={3}
value={panel.customInstruction}
/>
</label>
) : null}
<div className="edgeever-ai-result-heading">
- <span>{english ? "AI draft" : "AI 草稿"}</span>
- {panel.generating ? <small>{english ? "Generating…" : "生成中…"}</small> : null}
+ <span>{getMobileEditorCopy(locale).ai.draft}</span>
+ {panel.generating ? <small>{getMobileEditorCopy(locale).ai.generating}</small> : null}
</div>
<div aria-live="polite" className="edgeever-ai-result">
- {panel.output || <span>{english ? "The generated draft will appear here." : "生成的草稿会显示在这里。"}</span>}
+ {panel.output || <span>{getMobileEditorCopy(locale).ai.draftPlaceholder}</span>}
</div>
{panel.output && !panel.generating ? (
<label>
- <span>{english ? "Refine result" : "继续调整"}</span>
+ <span>{getMobileEditorCopy(locale).ai.refineResult}</span>
<div className="edgeever-ai-refine-row">
<input
maxLength={2000}
@@ -2064,11 +2032,11 @@ const MobileSelectionAiPanel = ({
onRefine(panel.refineInstruction);
}
}}
- placeholder={english ? "Make it more concise" : "例如:再简洁一点"}
+ placeholder={getMobileEditorCopy(locale).ai.refinePlaceholder}
value={panel.refineInstruction}
/>
<button disabled={!panel.refineInstruction.trim()} onClick={() => onRefine(panel.refineInstruction)} type="button">
- {english ? "Refine" : "调整"}
+ {getMobileEditorCopy(locale).ai.refine}
</button>
</div>
</label>
@@ -2078,17 +2046,17 @@ const MobileSelectionAiPanel = ({
<footer className="edgeever-ai-panel-footer">
<div>
<button disabled={appendDisabled} onClick={() => onApply("append")} type="button">
- {english ? "Insert after" : "插入到选区后"}
+ {getMobileEditorCopy(locale).ai.insertAfter}
</button>
<button disabled={replaceDisabled} onClick={() => onApply("replace")} type="button">
- {english ? "Replace selection" : "替换选中内容"}
+ {getMobileEditorCopy(locale).ai.replaceSelection}
</button>
</div>
{panel.generating ? (
- <button className="is-primary" onClick={onStop} type="button">{english ? "Stop" : "停止"}</button>
+ <button className="is-primary" onClick={onStop} type="button">{getMobileEditorCopy(locale).ai.stop}</button>
) : (
<button className="is-primary" disabled={generateDisabled} onClick={onGenerate} type="button">
- {panel.output ? (english ? "Regenerate" : "重新生成") : (english ? "Generate" : "生成")}
+ {panel.output ? getMobileEditorCopy(locale).ai.regenerate : getMobileEditorCopy(locale).ai.generate}
</button>
)}
</footer>
@@ -2104,7 +2072,7 @@ const MobileSelectionAiPanel = ({
<div aria-hidden="true" className="edgeever-ai-picker-handle" />
<header className="edgeever-ai-picker-header">
<strong>{pickerTitle}</strong>
- <button aria-label={english ? "Close" : "关闭"} onClick={() => setPicker(null)} type="button">×</button>
+ <button aria-label={getMobileEditorCopy(locale).close} onClick={() => setPicker(null)} type="button">×</button>
</header>
<div aria-label={pickerTitle} className="edgeever-ai-picker-options" role="radiogroup">
{pickerOptions.map((option) => (
@@ -2369,12 +2337,12 @@ const createMobileCodeBlockExtension = (
message.className = "edgeever-mermaid-message";
svgContainer.className = "edgeever-mermaid-svg";
svgContainer.setAttribute("role", "img");
- svgContainer.setAttribute("aria-label", locale !== "zh-CN" ? "Mermaid diagram preview" : "Mermaid 图表预览");
+ svgContainer.setAttribute("aria-label", getMobileEditorCopy(locale).codeBlock.mermaidPreview);
copyButton.type = "button";
copyButton.className = "edgeever-code-copy-button";
copyButton.contentEditable = "false";
- copyButton.setAttribute("aria-label", locale !== "zh-CN" ? "Copy code" : "复制代码");
- copyButton.textContent = locale !== "zh-CN" ? "Copy code" : "复制代码";
+ copyButton.setAttribute("aria-label", getMobileEditorCopy(locale).codeBlock.copy);
+ copyButton.textContent = getMobileEditorCopy(locale).codeBlock.copy;
copyButton.addEventListener("pointerdown", (event) => {
event.preventDefault();
event.stopPropagation();
@@ -2383,21 +2351,21 @@ const createMobileCodeBlockExtension = (
event.preventDefault();
event.stopPropagation();
void Clipboard.setStringAsync(currentNode.textContent).then(() => {
- copyButton.textContent = locale !== "zh-CN" ? "Copied" : "已复制";
- copyButton.setAttribute("aria-label", locale !== "zh-CN" ? "Copied" : "已复制");
+ copyButton.textContent = getMobileEditorCopy(locale).codeBlock.copied;
+ copyButton.setAttribute("aria-label", getMobileEditorCopy(locale).codeBlock.copied);
if (copyResetTimer !== null) window.clearTimeout(copyResetTimer);
copyResetTimer = window.setTimeout(() => {
- copyButton.textContent = locale !== "zh-CN" ? "Copy code" : "复制代码";
- copyButton.setAttribute("aria-label", locale !== "zh-CN" ? "Copy code" : "复制代码");
+ copyButton.textContent = getMobileEditorCopy(locale).codeBlock.copy;
+ copyButton.setAttribute("aria-label", getMobileEditorCopy(locale).codeBlock.copy);
copyResetTimer = null;
}, 1800);
}).catch(() => {
- copyButton.textContent = locale !== "zh-CN" ? "Copy failed" : "复制失败";
- copyButton.setAttribute("aria-label", locale !== "zh-CN" ? "Copy failed" : "复制失败");
+ copyButton.textContent = getMobileEditorCopy(locale).codeBlock.copyFailed;
+ copyButton.setAttribute("aria-label", getMobileEditorCopy(locale).codeBlock.copyFailed);
if (copyResetTimer !== null) window.clearTimeout(copyResetTimer);
copyResetTimer = window.setTimeout(() => {
- copyButton.textContent = locale !== "zh-CN" ? "Copy code" : "复制代码";
- copyButton.setAttribute("aria-label", locale !== "zh-CN" ? "Copy code" : "复制代码");
+ copyButton.textContent = getMobileEditorCopy(locale).codeBlock.copy;
+ copyButton.setAttribute("aria-label", getMobileEditorCopy(locale).codeBlock.copy);
copyResetTimer = null;
}, 1800);
});
@@ -2427,8 +2395,8 @@ const createMobileCodeBlockExtension = (
wrapper.dataset.language = language;
preview.hidden = !isMermaid;
code.setAttribute("aria-label", isMermaid
- ? (locale !== "zh-CN" ? "Mermaid source" : "Mermaid 源码")
- : (locale !== "zh-CN" ? "Code source" : "代码源码"));
+ ? getMobileEditorCopy(locale).codeBlock.mermaidSource
+ : getMobileEditorCopy(locale).codeBlock.codeSource);
if (!isMermaid) {
preview.replaceChildren();
return;
@@ -2437,7 +2405,7 @@ const createMobileCodeBlockExtension = (
const source = currentNode.textContent.trim();
if (!source) {
message.className = "edgeever-mermaid-message";
- message.textContent = locale !== "zh-CN" ? "Enter Mermaid source below." : "请在下方输入 Mermaid 源码。";
+ message.textContent = getMobileEditorCopy(locale).codeBlock.mermaidEmpty;
preview.replaceChildren(message);
return;
}
@@ -2445,7 +2413,7 @@ const createMobileCodeBlockExtension = (
const activeRequest = renderRequest;
renderTimer = window.setTimeout(() => {
message.className = "edgeever-mermaid-message";
- message.textContent = locale !== "zh-CN" ? "Rendering diagram…" : "正在渲染图表…";
+ message.textContent = getMobileEditorCopy(locale).codeBlock.rendering;
preview.replaceChildren(message);
void loadMermaid()
.then(async (mermaid) => {
@@ -2487,9 +2455,7 @@ const createMobileCodeBlockExtension = (
return;
}
message.className = "edgeever-mermaid-error";
- message.textContent = locale !== "zh-CN"
- ? "Unable to render this diagram. Check its syntax."
- : "无法渲染此图表,请检查语法。";
+ message.textContent = getMobileEditorCopy(locale).codeBlock.renderFailed;
preview.replaceChildren(message);
});
}, 300);
@@ -2674,7 +2640,7 @@ const createProtectedImageExtension = (
const spinner = document.createElement("span");
spinner.className = "edgeever-image-upload-spinner";
spinner.setAttribute("aria-hidden", "true");
- overlay.append(spinner, locale !== "zh-CN" ? "Uploading image…" : "图片上传中…");
+ overlay.append(spinner, getMobileEditorCopy(locale).image.uploading);
if (previewSource) {
placeholder.append(preview);
}
@@ -2729,7 +2695,7 @@ const createProtectedImageExtension = (
if (activeRequestId !== requestId) {
return;
}
- overlay.textContent = locale !== "zh-CN" ? "Image failed to load" : "图片加载失败";
+ overlay.textContent = getMobileEditorCopy(locale).image.loadFailed;
};
preload.src = displaySource;
};
@@ -2754,11 +2720,11 @@ const createProtectedImageExtension = (
revealLoadedImage(dataUrl, attributes, activeRequestId);
return;
}
- overlay.textContent = locale !== "zh-CN" ? "Image failed to load" : "图片加载失败";
+ overlay.textContent = getMobileEditorCopy(locale).image.loadFailed;
})
.catch(() => {
if (activeRequestId === requestId) {
- overlay.textContent = locale !== "zh-CN" ? "Image failed to load" : "图片加载失败";
+ overlay.textContent = getMobileEditorCopy(locale).image.loadFailed;
}
});
};
@@ -2822,7 +2788,7 @@ const createProtectedImageExtension = (
actionButton.className = "edgeever-image-actions";
actionButton.contentEditable = "false";
actionButton.hidden = true;
- actionButton.setAttribute("aria-label", locale !== "zh-CN" ? "Image actions" : "图片操作");
+ actionButton.setAttribute("aria-label", getMobileEditorCopy(locale).image.actions);
actionButton.textContent = "⋯";
bindImageActionButton(wrapper, actionButton);
image.addEventListener("click", (event) => {
@@ -2858,7 +2824,7 @@ const createProtectedImageExtension = (
loading.replaceChildren();
const label = document.createElement("span");
label.className = "edgeever-image-loading-label";
- label.textContent = locale !== "zh-CN" ? "Image failed to load" : "图片加载失败";
+ label.textContent = getMobileEditorCopy(locale).image.loadFailed;
loading.append(label);
loading.hidden = false;
} else if (phase === "loading") {
diff --git a/apps/mobile/src/components/MobileAiAssistantModal.tsx b/apps/mobile/src/components/MobileAiAssistantModal.tsx
index fc2f065c..4b178ab8 100644
--- a/apps/mobile/src/components/MobileAiAssistantModal.tsx
+++ b/apps/mobile/src/components/MobileAiAssistantModal.tsx
@@ -23,7 +23,7 @@ import { Modal, ScrollView, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { Check, ChevronDown, Copy, RefreshCw, Sparkles, Square, X } from "./icons";
import { Alert, Pressable, Text, TextInput } from "./LocalizedText";
-import { useMobileLocale } from "../lib/mobile-locale";
+import { useMobileLocale, getMobileCatalog } from "../lib/mobile-locale";
import { useMobileTheme } from "../lib/mobile-theme";
import { readMobileAiAssistantLastAction, writeMobileAiAssistantLastAction } from "../lib/preferences";
import { useSession } from "../lib/session";
@@ -52,7 +52,6 @@ export const MobileAiAssistantModal = ({
const { resolvedLocale } = useMobileLocale();
const { resolvedTheme } = useMobileTheme();
const dark = resolvedTheme === "dark";
- const tr = (zh: string, en: string) => resolvedLocale !== "zh-CN" ? en : zh;
const [action, setAction] = useState<AssistantAction>("summarize");
const [selectedPromptId, setSelectedPromptId] = useState<string | null>(null);
const [targetLanguage, setTargetLanguage] = useState<TargetLanguage>(() => getDefaultAiTargetLanguage(resolvedLocale));
@@ -81,41 +80,11 @@ export const MobileAiAssistantModal = ({
const resultMode = selectedPrompt?.resultMode
?? (["summarize", "extract-key-points", "extract-todos", "continue-writing"].includes(action) ? "append" : "both");
- const labels: Record<AssistantAction, string> = {
- summarize: tr("精简总结", "Summarize"),
- "extract-key-points": tr("提炼要点", "Key points"),
- "extract-todos": tr("提取待办", "Extract tasks"),
- "rewrite-proofread": tr("改写与校对", "Rewrite & proofread"),
- "improve-writing": tr("润色表达", "Polish"),
- "fix-spelling-grammar": tr("修正拼写与语法", "Fix spelling & grammar"),
- "make-shorter": tr("精炼表达", "Make concise"),
- "make-longer": tr("扩写内容", "Make longer"),
- "simplify-language": tr("简化表达", "Simplify language"),
- "change-tone": tr("调整语气", "Change tone"),
- translate: tr("全文翻译", "Translate"),
- "continue-writing": tr("继续写作", "Continue writing"),
- custom: tr("自定义指令", "Custom prompt"),
- };
+ const labels: Record<AssistantAction, string> = getMobileCatalog(resolvedLocale).aiAssistant.actions;
- const languageLabels: Record<TargetLanguage, string> = {
- en: tr("英语", "English"),
- "zh-CN": tr("简体中文", "Simplified Chinese"),
- "zh-TW": tr("繁体中文", "Traditional Chinese"),
- ja: tr("日语", "Japanese"),
- ko: tr("韩语", "Korean"),
- es: tr("西班牙语", "Spanish"),
- fr: tr("法语", "French"),
- de: tr("德语", "German"),
- pt: tr("葡萄牙语", "Portuguese"),
- pl: tr("波兰语", "Polish"),
- };
+ const languageLabels: Record<TargetLanguage, string> = getMobileCatalog(resolvedLocale).aiAssistant.targetLanguages;
- const toneLabels: Record<Tone, string> = {
- professional: tr("专业", "Professional"),
- friendly: tr("友好", "Friendly"),
- casual: tr("轻松", "Casual"),
- direct: tr("直接", "Direct"),
- };
+ const toneLabels: Record<Tone, string> = getMobileCatalog(resolvedLocale).aiAssistant.tones;
useEffect(() => () => controllerRef.current?.abort(), []);
useEffect(() => {
@@ -215,8 +184,8 @@ export const MobileAiAssistantModal = ({
if (controller.signal.aborted) return;
setError(
caught instanceof ApiRequestError && caught.code === "ai_not_configured"
- ? tr("请先在 Web 或桌面端的“模型与代理”中配置模型。", "Configure a model in Models and agents on the web or desktop app first.")
- : caught instanceof Error ? caught.message : tr("AI 生成失败。", "AI generation failed.")
+ ? getMobileCatalog(resolvedLocale).mobile.ai.modelNotConfigured
+ : caught instanceof Error ? caught.message : getMobileCatalog(resolvedLocale).mobile.ai.generationFailed
);
} finally {
if (controllerRef.current === controller) {
@@ -240,10 +209,10 @@ export const MobileAiAssistantModal = ({
setError(null);
try {
await onApply(output, mode);
- Alert.alert(tr("已更新笔记", "Note updated"));
+ Alert.alert(getMobileCatalog(resolvedLocale).mobile.ai.noteUpdated);
onClose();
} catch (caught) {
- setError(caught instanceof Error ? caught.message : tr("更新笔记失败。", "Could not update the note."));
+ setError(caught instanceof Error ? caught.message : getMobileCatalog(resolvedLocale).mobile.ai.noteUpdateFailed);
} finally {
setApplying(false);
}
@@ -311,27 +280,27 @@ export const MobileAiAssistantModal = ({
<View style={[styles.header, { borderBottomColor: border }]}>
<View style={styles.titleRow}>
<Sparkles color="#16A06E" size={20} />
- <Text style={[styles.title, { color: foreground }]}>{tr("AI 笔记助手", "AI note assistant")}</Text>
+ <Text style={[styles.title, { color: foreground }]}>{getMobileCatalog(resolvedLocale).aiAssistant.title}</Text>
</View>
- <Pressable accessibilityLabel={tr("关闭", "Close")} accessibilityRole="button" onPress={onClose} style={styles.iconButton}>
+ <Pressable accessibilityLabel={getMobileCatalog(resolvedLocale).common.close} accessibilityRole="button" onPress={onClose} style={styles.iconButton}>
<X color={muted} size={22} />
</Pressable>
</View>
<ScrollView contentContainerStyle={styles.content} keyboardShouldPersistTaps="handled">
<Text style={[styles.description, { color: muted }]}>
- {tr("选择 AI 要做的事。输出只会作为草稿,确认后才会修改笔记。", "Choose what AI should do. Output remains a draft until you apply it.")}
+ {getMobileCatalog(resolvedLocale).mobile.ai.intro}
</Text>
- {selectField(tr("处理方式", "Action"), selectedPrompt?.name ?? labels[action], () => setPicker("action"))}
- {promptNeedsTargetLanguage(parameterKind) ? selectField(tr("目标语言", "Target language"), languageLabels[targetLanguage], () => setPicker("language")) : null}
- {promptNeedsTone(parameterKind) ? selectField(tr("语气", "Tone"), toneLabels[tone], () => setPicker("tone")) : null}
+ {selectField(getMobileCatalog(resolvedLocale).aiAssistant.actionLabel, selectedPrompt?.name ?? labels[action], () => setPicker("action"))}
+ {promptNeedsTargetLanguage(parameterKind) ? selectField(getMobileCatalog(resolvedLocale).aiAssistant.targetLanguage, languageLabels[targetLanguage], () => setPicker("language")) : null}
+ {promptNeedsTone(parameterKind) ? selectField(getMobileCatalog(resolvedLocale).aiAssistant.tone, toneLabels[tone], () => setPicker("tone")) : null}
{!selectedPrompt && action === "custom" ? (
<View style={styles.field}>
- <Text style={[styles.fieldLabel, { color: foreground }]}>{tr("告诉 AI 你想怎么处理", "Tell AI what to do")}</Text>
+ <Text style={[styles.fieldLabel, { color: foreground }]}>{getMobileCatalog(resolvedLocale).aiAssistant.customInstruction}</Text>
<TextInput
maxLength={2000}
multiline
onChangeText={setCustomInstruction}
- placeholder={tr("例如:改成适合周报的结构,保留所有数据", "For example: Restructure this for a weekly report and keep all data")}
+ placeholder={getMobileCatalog(resolvedLocale).mobile.ai.instructionPlaceholder}
placeholderTextColor={muted}
style={[styles.instructionInput, { borderColor: border, color: foreground, backgroundColor: surface }]}
value={customInstruction}
@@ -339,30 +308,30 @@ export const MobileAiAssistantModal = ({
</View>
) : null}
<View style={styles.resultHeader}>
- <Text style={[styles.fieldLabel, { color: foreground }]}>{tr("AI 草稿", "AI draft")}</Text>
- {generating ? <Text style={styles.streaming}>{tr("生成中…", "Generating…")}</Text> : null}
+ <Text style={[styles.fieldLabel, { color: foreground }]}>{getMobileCatalog(resolvedLocale).mobile.ai.draft}</Text>
+ {generating ? <Text style={styles.streaming}>{getMobileCatalog(resolvedLocale).mobile.ai.generating}</Text> : null}
</View>
<View style={[styles.result, { borderColor: border, backgroundColor: mutedSurface }]}>
<Text selectable style={[styles.resultText, { color: output ? foreground : muted }]}>
- {output || tr("生成的草稿会显示在这里。", "The generated draft will appear here.")}
+ {output || getMobileCatalog(resolvedLocale).mobile.ai.draftPlaceholder}
</Text>
</View>
{output && !generating ? (
<View style={styles.field}>
- <Text style={[styles.fieldLabel, { color: foreground }]}>{tr("继续调整", "Refine result")}</Text>
+ <Text style={[styles.fieldLabel, { color: foreground }]}>{getMobileCatalog(resolvedLocale).mobile.ai.refineResult}</Text>
<View style={styles.refineRow}>
<TextInput
maxLength={2000}
onChangeText={setRefineInstruction}
onSubmitEditing={refine}
- placeholder={tr("例如:再简洁一点", "For example: Make it more concise")}
+ placeholder={getMobileCatalog(resolvedLocale).mobile.ai.refinePlaceholder}
placeholderTextColor={muted}
returnKeyType="send"
style={[styles.refineInput, { borderColor: border, color: foreground, backgroundColor: surface }]}
value={refineInstruction}
/>
<Pressable disabled={!refineInstruction.trim()} onPress={refine} style={[styles.refineButton, !refineInstruction.trim() && styles.disabled]}>
- <Text style={styles.refineButtonText}>{tr("调整", "Refine")}</Text>
+ <Text style={styles.refineButtonText}>{getMobileCatalog(resolvedLocale).aiAssistant.refineAction}</Text>
</Pressable>
</View>
</View>
@@ -373,28 +342,28 @@ export const MobileAiAssistantModal = ({
<View style={styles.footerRow}>
<Pressable disabled={!output || generating} onPress={() => void Clipboard.setStringAsync(output)} style={[styles.secondaryButton, { borderColor: border }, (!output || generating) && styles.disabled]}>
<Copy color={foreground} size={16} />
- <Text style={[styles.secondaryText, { color: foreground }]}>{tr("复制", "Copy")}</Text>
+ <Text style={[styles.secondaryText, { color: foreground }]}>{getMobileCatalog(resolvedLocale).mobile.ai.copy}</Text>
</Pressable>
{promptAllowsAppend(resultMode) ? (
<Pressable disabled={!output || generating || applying} onPress={() => void apply("append")} style={[styles.secondaryButton, { borderColor: border }, (!output || generating || applying) && styles.disabled]}>
- <Text style={[styles.secondaryText, { color: foreground }]}>{tr("追加", "Append")}</Text>
+ <Text style={[styles.secondaryText, { color: foreground }]}>{getMobileCatalog(resolvedLocale).mobile.ai.append}</Text>
</Pressable>
) : null}
{promptAllowsReplace(resultMode) ? (
<Pressable disabled={!output || generating || applying} onPress={() => void apply("replace")} style={[styles.secondaryButton, { borderColor: border }, (!output || generating || applying) && styles.disabled]}>
- <Text style={[styles.secondaryText, { color: foreground }]}>{tr("替换", "Replace")}</Text>
+ <Text style={[styles.secondaryText, { color: foreground }]}>{getMobileCatalog(resolvedLocale).mobile.ai.replace}</Text>
</Pressable>
) : null}
</View>
{generating ? (
<Pressable onPress={() => controllerRef.current?.abort()} style={styles.primaryButton}>
<Square color="#ffffff" size={14} />
- <Text style={styles.primaryText}>{tr("停止", "Stop")}</Text>
+ <Text style={styles.primaryText}>{getMobileCatalog(resolvedLocale).aiAssistant.stop}</Text>
</Pressable>
) : (
<Pressable disabled={actionDisabled} onPress={() => void generate()} style={[styles.primaryButton, actionDisabled && styles.disabled]}>
{output ? <RefreshCw color="#ffffff" size={16} /> : null}
- <Text style={styles.primaryText}>{output ? tr("重新生成", "Regenerate") : tr("生成", "Generate")}</Text>
+ <Text style={styles.primaryText}>{output ? getMobileCatalog(resolvedLocale).mobile.ai.regenerate : getMobileCatalog(resolvedLocale).aiAssistant.generate}</Text>
</Pressable>
)}
</View>
@@ -402,7 +371,7 @@ export const MobileAiAssistantModal = ({
<Pressable onPress={() => setPicker(null)} style={styles.pickerBackdrop}>
<View style={[styles.pickerSheet, { backgroundColor: surface }]}>
<Text style={[styles.pickerTitle, { color: foreground }]}>
- {picker === "action" ? tr("选择处理方式", "Choose an action") : picker === "language" ? tr("选择目标语言", "Choose target language") : tr("选择语气", "Choose tone")}
+ {picker === "action" ? getMobileCatalog(resolvedLocale).mobile.ai.chooseAction : picker === "language" ? getMobileCatalog(resolvedLocale).mobile.ai.chooseTargetLanguage : getMobileCatalog(resolvedLocale).mobile.ai.chooseTone}
</Text>
<ScrollView style={styles.pickerScroll}>
{pickerOptions.map((option) => (
diff --git a/apps/mobile/src/components/MobileMermaid.tsx b/apps/mobile/src/components/MobileMermaid.tsx
index 931450c8..011a4b6e 100644
--- a/apps/mobile/src/components/MobileMermaid.tsx
+++ b/apps/mobile/src/components/MobileMermaid.tsx
@@ -4,6 +4,7 @@ import { SvgXml } from "react-native-svg";
import LocalTiptapEditor from "./LocalTiptapEditor";
import { SAFE_DOM_WEBVIEW_PROPS } from "../lib/mobile-dom";
import { getMermaidSvgAspectRatio, sanitizeMobileMermaidSvg } from "../lib/mobile-mermaid";
+import { getMobileCatalog } from "../lib/mobile-locale";
type MermaidResult = { source: string; svg: string | null };
type MermaidContextValue = {
@@ -96,16 +97,16 @@ export const MobileMermaidDiagram = ({
useEffect(() => normalizedSource ? register?.(normalizedSource) : undefined, [normalizedSource, register]);
if (!normalizedSource) {
- return <Text style={[styles.message, theme === "dark" && styles.messageDark]}>{locale !== "zh-CN" ? "This Mermaid diagram is empty." : "此 Mermaid 图表暂无内容。"}</Text>;
+ return <Text style={[styles.message, theme === "dark" && styles.messageDark]}>{getMobileCatalog(locale).mobile.mermaid.empty}</Text>;
}
const hasResult = context?.results.has(normalizedSource) ?? false;
const svg = context?.results.get(normalizedSource) ?? null;
if (!hasResult) {
- return <Text style={[styles.message, theme === "dark" && styles.messageDark]}>{locale !== "zh-CN" ? "Rendering diagram…" : "正在渲染图表…"}</Text>;
+ return <Text style={[styles.message, theme === "dark" && styles.messageDark]}>{getMobileCatalog(locale).mobile.mermaid.rendering}</Text>;
}
if (!svg) {
- return <Text accessibilityRole="alert" style={styles.error}>{locale !== "zh-CN" ? "Unable to render this Mermaid diagram. Check its syntax." : "无法渲染此 Mermaid 图表,请检查语法。"}</Text>;
+ return <Text accessibilityRole="alert" style={styles.error}>{getMobileCatalog(locale).mobile.mermaid.renderFailed}</Text>;
}
const aspectRatio = getMermaidSvgAspectRatio(svg);
@@ -113,7 +114,7 @@ export const MobileMermaidDiagram = ({
const height = Math.min(440, Math.max(120, availableWidth / aspectRatio));
const nativeSvg = sanitizeMobileMermaidSvg(svg);
return (
- <View accessibilityLabel={locale !== "zh-CN" ? "Mermaid diagram" : "Mermaid 图表"} accessible style={[styles.diagram, theme === "dark" && styles.diagramDark, { height }]}>
+ <View accessibilityLabel={getMobileCatalog(locale).mobile.mermaid.label} accessible style={[styles.diagram, theme === "dark" && styles.diagramDark, { height }]}>
<SvgXml height="100%" width="100%" xml={nativeSvg} />
</View>
);
diff --git a/apps/mobile/src/components/MobileNoteImageFontPicker.tsx b/apps/mobile/src/components/MobileNoteImageFontPicker.tsx
index e52d80be..a19c2407 100644
--- a/apps/mobile/src/components/MobileNoteImageFontPicker.tsx
+++ b/apps/mobile/src/components/MobileNoteImageFontPicker.tsx
@@ -5,13 +5,21 @@ import type { DOMProps } from "expo/dom";
import { isRemoteNoteImageFont } from "@edgeever/shared/font-catalog";
import { resolveNoteImageTypography, type NoteImageFontStyle, type NoteImageTheme } from "@edgeever/shared/note-image-card";
import { prepareNoteImageAssets } from "@edgeever/shared/note-image-fonts";
-import { getMobileNoteImageFontLabel, MOBILE_FONT_OPTIONS } from "../lib/note-image-font-options";
+import { getMobileNoteImageFontLabel, MOBILE_FONT_OPTIONS, type NoteImageFontLabels } from "../lib/note-image-font-options";
import { noteImageAssetUrls } from "./note-image-asset-urls";
+export type MobileNoteImageFontPickerCopy = NoteImageFontLabels & {
+ title: string;
+ loadingPreview: string;
+ previewUnavailable: string;
+};
+
type Props = {
selected: NoteImageFontStyle;
theme: NoteImageTheme;
+ /** Picks the Chinese sample sentence for CJK fonts; UI copy comes from `copy`. */
chinese: boolean;
+ copy: MobileNoteImageFontPickerCopy;
onSelect: (font: NoteImageFontStyle) => Promise<void>;
dom?: DOMProps;
};
@@ -19,7 +27,7 @@ type Props = {
// Latin-only fonts need Latin characters to make their appearance comparable.
const LATIN_FONTS = new Set(["anton", "inter", "dmserif", "bebas", "spacegrotesk", "jetbrains", "mono"]);
-export default function MobileNoteImageFontPicker({ selected, theme, chinese, onSelect }: Props) {
+export default function MobileNoteImageFontPicker({ selected, theme, chinese, copy, onSelect }: Props) {
const listRef = useRef<HTMLDivElement>(null);
const selectingRef = useRef(false);
const [previews, setPreviews] = useState<Record<string, "ready" | "error">>({});
@@ -62,9 +70,9 @@ export default function MobileNoteImageFontPicker({ selected, theme, chinese, on
.font-status { display: block; margin-top: 6px; color: #64748b; font: 13px/1.5 system-ui, sans-serif; }
.font-check { flex: 0 0 24px; color: #16a06e; font: 700 24px/1 system-ui, sans-serif; }
`}</style>
- <div className="font-list" role="radiogroup" aria-label={chinese ? "字体风格" : "Typography"} ref={listRef}>
+ <div className="font-list" role="radiogroup" aria-label={copy.title} ref={listRef}>
{MOBILE_FONT_OPTIONS.map(item => {
- const label = getMobileNoteImageFontLabel(item.id, theme, chinese, true);
+ const label = getMobileNoteImageFontLabel(item.id, theme, copy, true);
const loaded = previews[item.id] === "ready";
const failed = previews[item.id] === "error";
const needsFont = item.id === "auto" || isRemoteNoteImageFont(item.id);
@@ -89,8 +97,8 @@ export default function MobileNoteImageFontPicker({ selected, theme, chinese, on
<span className="font-sample" style={{ fontFamily: resolveNoteImageTypography(theme, item.id).bodyFamily }}>{sampleFor(item.id)}</span>
) : (
<span className="font-status">{failed
- ? (chinese ? "示例暂不可用,仍可选择" : "Preview unavailable; you can still select this font")
- : (chinese ? "正在加载示例…" : "Loading preview…")}</span>
+ ? copy.previewUnavailable
+ : copy.loadingPreview}</span>
)}
</span>
<span className="font-check" aria-hidden="true">{selected === item.id ? "✓" : ""}</span>
diff --git a/apps/mobile/src/components/MobileResourceActions.tsx b/apps/mobile/src/components/MobileResourceActions.tsx
index 41945873..17e4f401 100644
--- a/apps/mobile/src/components/MobileResourceActions.tsx
+++ b/apps/mobile/src/components/MobileResourceActions.tsx
@@ -7,7 +7,7 @@ import {
type MobileAttachmentTarget,
type MobileResourceTarget,
} from "../lib/mobile-attachments";
-import { useMobileLocale } from "../lib/mobile-locale";
+import { useMobileLocale, getMobileCatalog } from "../lib/mobile-locale";
import { useMobileTheme } from "../lib/mobile-theme";
type MobileResourceActionsProps = {
@@ -147,7 +147,7 @@ export const MobileAttachmentCard = ({
return (
<View style={[styles.card, dark && styles.cardDark]}>
<Pressable
- accessibilityHint={resolvedLocale !== "zh-CN" ? "Opens the system share sheet for this attachment" : "打开系统分享面板分享此附件"}
+ accessibilityHint={getMobileCatalog(resolvedLocale).mobile.resources.shareAttachmentHint}
accessibilityLabel={target.filename}
accessibilityRole="button"
disabled={busy}
@@ -170,7 +170,7 @@ export const MobileAttachmentCard = ({
</View>
</Pressable>
<Pressable
- accessibilityLabel={resolvedLocale !== "zh-CN" ? "Attachment actions" : "附件操作"}
+ accessibilityLabel={getMobileCatalog(resolvedLocale).mobile.resources.attachmentActions}
accessibilityRole="button"
disabled={busy}
onPress={onActions}
diff --git a/apps/mobile/src/components/MobileUpdateCard.tsx b/apps/mobile/src/components/MobileUpdateCard.tsx
index e44a4165..9532e309 100644
--- a/apps/mobile/src/components/MobileUpdateCard.tsx
+++ b/apps/mobile/src/components/MobileUpdateCard.tsx
@@ -3,7 +3,7 @@ import * as Updates from "expo-updates";
import { StyleSheet, View } from "react-native";
import { ActivityIndicator, RefreshCw } from "./icons";
import { Pressable, Text } from "./LocalizedText";
-import { useMobileLocale } from "../lib/mobile-locale";
+import { useMobileLocale, getMobileCatalog } from "../lib/mobile-locale";
import { useMobileUpdate } from "../lib/mobile-update";
import { useMobileTheme, resolveMobileThemeStyles } from "../lib/mobile-theme";
@@ -11,33 +11,30 @@ export const MobileUpdateCard = () => {
const { resolvedLocale } = useMobileLocale();
const { resolvedTheme } = useMobileTheme();
const { checkForUpdate, hasUpdate, isSupported, openUpdate, status, updateKind } = useMobileUpdate();
- const english = resolvedLocale !== "zh-CN";
const busy = status === "checking" || status === "downloading";
const styles = resolveMobileThemeStyles(baseStyles, resolvedTheme);
const checkLabel = status === "checking"
- ? (english ? "Checking…" : "正在检查…")
- : (english ? "Check for updates" : "检查更新");
+ ? getMobileCatalog(resolvedLocale).mobile.update.checking
+ : getMobileCatalog(resolvedLocale).mobile.update.checkForUpdates;
const openLabel = status === "downloading"
- ? (english ? "Downloading update…" : "正在下载更新…")
+ ? getMobileCatalog(resolvedLocale).mobile.update.downloadingUpdate
: status === "ready"
- ? (english ? "Restart to apply" : "重启以应用")
+ ? getMobileCatalog(resolvedLocale).mobile.update.restartToApply
: updateKind === "ota"
- ? (english ? "Download update" : "下载更新")
+ ? getMobileCatalog(resolvedLocale).mobile.update.downloadUpdate
: updateKind === "play"
- ? (english ? "Update with Google Play" : "通过 Google Play 更新")
- : (english ? "Choose update source" : "选择更新渠道");
+ ? getMobileCatalog(resolvedLocale).mobile.update.updateWithGooglePlay
+ : getMobileCatalog(resolvedLocale).mobile.update.chooseSource;
return (
<View style={styles.card}>
<View style={styles.copy}>
- <Text style={styles.title}>{english ? "App updates" : "应用更新"}</Text>
+ <Text style={styles.title}>{getMobileCatalog(resolvedLocale).mobile.update.title}</Text>
<Text style={styles.description}>
- {english
- ? "EdgeEver automatically checks for compatible in-app updates and newer app versions."
- : "EdgeEver 会自动检查兼容的应用内热更新和新版应用。"}
+ {getMobileCatalog(resolvedLocale).mobile.update.description}
</Text>
<Text style={styles.version}>
- {english ? "Current version" : "当前版本"}: v{Updates.runtimeVersion ?? Constants.expoConfig?.version ?? "unknown"}
+ {getMobileCatalog(resolvedLocale).mobile.update.currentVersion}: v{Updates.runtimeVersion ?? Constants.expoConfig?.version ?? "unknown"}
</Text>
</View>
{hasUpdate ? (
@@ -64,7 +61,7 @@ export const MobileUpdateCard = () => {
</Pressable>
{!isSupported ? (
<Text style={styles.hint}>
- {english ? "Available in installed release builds." : "此功能会在已安装的正式版中启用。"}
+ {getMobileCatalog(resolvedLocale).mobile.update.releaseBuildsOnly}
</Text>
) : null}
</View>
diff --git a/apps/mobile/src/hooks/useMobileEditorResourceActions.ts b/apps/mobile/src/hooks/useMobileEditorResourceActions.ts
index cb3a11f3..4ae01a2e 100644
--- a/apps/mobile/src/hooks/useMobileEditorResourceActions.ts
+++ b/apps/mobile/src/hooks/useMobileEditorResourceActions.ts
@@ -10,6 +10,7 @@ import {
} from "../lib/mobile-attachments";
import { loadProtectedResourceDataUrl, type ProtectedResourceLoadFailure } from "../lib/mobile-protected-resources";
import { safeDomCall } from "../lib/safe-dom-call";
+import { formatMobileCopy, getMobileCatalog, type MobileLocale } from "../lib/mobile-locale";
type Client = ReturnType<typeof createEdgeEverClient> | null;
@@ -20,7 +21,7 @@ type Options = {
editorRef: MutableRefObject<LocalTiptapEditorRef | null>;
onLoadFailure: (failure: ProtectedResourceLoadFailure) => void;
onSelect: (target: MobileResourceTarget) => void;
- resolvedLocale: string;
+ resolvedLocale: MobileLocale;
resourceCacheRef: MutableRefObject<Map<string, Promise<string | null>>>;
sessionBaseUrl?: string;
token?: string;
@@ -38,9 +39,6 @@ export const useMobileEditorResourceActions = ({
sessionBaseUrl,
token,
}: Options) => {
- const unavailable = useCallback((english: string, chinese: string) =>
- new Error(resolvedLocale !== "zh-CN" ? english : chinese), [resolvedLocale]);
-
const loadEditorResource = useCallback((source: string) => {
if (!client) return Promise.resolve(null);
return loadProtectedResourceDataUrl(source, {
@@ -53,27 +51,27 @@ export const useMobileEditorResourceActions = ({
}, [baseUrl, client, onLoadFailure, resourceCacheRef, sessionBaseUrl, token]);
const downloadResource = useCallback(async (target: MobileResourceTarget) => {
- if (!client) throw unavailable("The attachment client is unavailable.", "当前无法读取附件。");
+ if (!client) throw new Error(getMobileCatalog(resolvedLocale).mobile.resources.attachmentUnavailable);
await openMobileResource(client, target, { baseUrl: sessionBaseUrl ?? baseUrl, token });
- }, [baseUrl, client, sessionBaseUrl, token, unavailable]);
+ }, [baseUrl, client, sessionBaseUrl, resolvedLocale, token]);
const saveResourceAs = useCallback(async (target: MobileResourceTarget) => {
- if (!client) throw unavailable("The resource client is unavailable.", "当前无法读取资源。");
+ if (!client) throw new Error(getMobileCatalog(resolvedLocale).mobile.common.resourceUnavailable);
const result = await saveMobileResourceAs(client, target, { baseUrl: sessionBaseUrl ?? baseUrl, token });
if (result.kind === "saf") {
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Downloaded" : "下载成功",
- resolvedLocale !== "zh-CN" ? `Saved ${result.filename}` : `已保存:${result.filename}`,
+ getMobileCatalog(resolvedLocale).mobile.common.downloaded,
+ formatMobileCopy(getMobileCatalog(resolvedLocale).mobile.common.savedFile, { filename: result.filename }),
);
}
- }, [baseUrl, client, resolvedLocale, sessionBaseUrl, token, unavailable]);
+ }, [baseUrl, client, resolvedLocale, sessionBaseUrl, token]);
const requireMutableClient = useCallback(() => {
if (!client || !canMutate()) {
- throw unavailable("Wait for this note to sync first.", "请等待笔记同步完成。");
+ throw new Error(getMobileCatalog(resolvedLocale).mobile.resources.waitForSync);
}
return client;
- }, [canMutate, client, unavailable]);
+ }, [canMutate, client, resolvedLocale]);
const renameResource = useCallback(async (target: MobileResourceTarget, filename: string) => {
const mutableClient = requireMutableClient();
diff --git a/apps/mobile/src/hooks/useMobileRichEditor.ts b/apps/mobile/src/hooks/useMobileRichEditor.ts
index 73c58f71..a57b907c 100644
--- a/apps/mobile/src/hooks/useMobileRichEditor.ts
+++ b/apps/mobile/src/hooks/useMobileRichEditor.ts
@@ -20,7 +20,7 @@ import {
} from "../lib/mobile-editor-controller";
import { clearMobileMemoDraft, writeMobileMemoDraft, type MobileMemoDraft } from "../lib/mobile-drafts";
import { prepareUploadAsset } from "../lib/mobile-image-upload";
-import { localizeMissingNotebookName, useMobileLocale } from "../lib/mobile-locale";
+import { localizeMissingNotebookName, useMobileLocale, getMobileCatalog, formatMobileCopy } from "../lib/mobile-locale";
import { useSession } from "../lib/session";
import { recordEditorStartup } from "../lib/startup-performance";
import { safeDomCall } from "../lib/safe-dom-call";
@@ -69,14 +69,10 @@ const alertProtectedImageLoadFailure = (
) => {
const statusLabel = failure.status != null
? String(failure.status)
- : locale !== "zh-CN"
- ? "network error"
- : "网络错误";
+ : getMobileCatalog(locale).mobile.common.networkError;
Alert.alert(
- locale !== "zh-CN" ? "Image failed to load" : "图片加载失败",
- locale !== "zh-CN"
- ? `Could not load a note image (${statusLabel}). Check the network and try again.`
- : `笔记中的图片未能加载(${statusLabel})。请检查网络后重试。`
+ getMobileCatalog(locale).mobile.common.imageLoadFailed,
+ formatMobileCopy(getMobileCatalog(locale).mobile.common.noteImageLoadFailed, { status: statusLabel })
);
};
diff --git a/apps/mobile/src/hooks/useMobileSelectionAi.ts b/apps/mobile/src/hooks/useMobileSelectionAi.ts
index 76bfad26..988e7a00 100644
--- a/apps/mobile/src/hooks/useMobileSelectionAi.ts
+++ b/apps/mobile/src/hooks/useMobileSelectionAi.ts
@@ -5,6 +5,7 @@ import type { LocalTiptapEditorRef } from "../components/LocalTiptapEditor";
import { buildMobileAiStreamBridgePayload, parseMobileSelectionAiRequest } from "../lib/mobile-ai-selection";
import { safeDomCall } from "../lib/safe-dom-call";
import type { useSession } from "../lib/session";
+import { getMobileCatalog } from "../lib/mobile-locale";
type MobileAiClient = NonNullable<ReturnType<typeof useSession>["client"]>;
@@ -37,9 +38,9 @@ export const useMobileSelectionAi = ({
}, []);
const requestSelectionAi = useCallback(async (requestJson: string) => {
- if (!client) throw new Error(resolvedLocale !== "zh-CN" ? "AI is unavailable while signed out." : "当前未登录,无法使用 AI。");
+ if (!client) throw new Error(getMobileCatalog(resolvedLocale).mobile.ai.signedOut);
const request = parseMobileSelectionAiRequest(requestJson);
- if (!request) throw new Error(resolvedLocale !== "zh-CN" ? "The AI request is invalid." : "AI 请求无效。");
+ if (!request) throw new Error(getMobileCatalog(resolvedLocale).mobile.ai.invalidRequest);
activeRequestRef.current?.controller.abort();
const controller = new AbortController();
@@ -64,12 +65,10 @@ export const useMobileSelectionAi = ({
}).catch((requestError) => {
if (controller.signal.aborted) return;
const message = requestError instanceof ApiRequestError && requestError.code === "ai_not_configured"
- ? (resolvedLocale !== "zh-CN"
- ? "Configure a model in Models and agents on the web or desktop app first."
- : "请先在 Web 或桌面端的“模型与代理”中配置模型。")
+ ? getMobileCatalog(resolvedLocale).mobile.ai.modelNotConfigured
: requestError instanceof Error
? requestError.message
- : resolvedLocale !== "zh-CN" ? "AI generation failed." : "AI 生成失败。";
+ : getMobileCatalog(resolvedLocale).mobile.ai.generationFailed;
safeDomCall(() => editorRef.current?.pushAiStreamEvent(buildMobileAiStreamBridgePayload(request.requestId, {
type: "error",
code: "ai_generation_failed",
diff --git a/apps/mobile/src/lib/login-error.test.mjs b/apps/mobile/src/lib/login-error.test.mjs
index 2b7fcf13..e25d7e97 100644
--- a/apps/mobile/src/lib/login-error.test.mjs
+++ b/apps/mobile/src/lib/login-error.test.mjs
@@ -15,6 +15,15 @@ describe("mobile login error messages", () => {
expect(formatMobileLoginError(error, "en-US")).toContain("A Cloudflare browser challenge intercepted the login API");
});
+ test("returns localized copy instead of falling back to English", () => {
+ expect(formatMobileLoginError(new ApiRequestError("Unauthorized", 401), "pl"))
+ .toContain("Nieprawidłowa nazwa użytkownika lub hasło.");
+ expect(formatMobileLoginError(new TypeError("Failed to fetch"), "pl"))
+ .toContain("Nie można połączyć się z instancją.");
+ expect(formatMobileLoginError(new ApiRequestError("Unauthorized", 401), "ja"))
+ .toContain("ユーザー名またはパスワードが正しくありません。");
+ });
+
test("distinguishes credentials, edge security blocks, and EdgeEver 403 responses", () => {
expect(formatMobileLoginError(new ApiRequestError("Unauthorized", 401), "zh-CN"))
.toContain("用户名或密码不正确");
diff --git a/apps/mobile/src/lib/login-error.ts b/apps/mobile/src/lib/login-error.ts
index 2c890ad8..089e880e 100644
--- a/apps/mobile/src/lib/login-error.ts
+++ b/apps/mobile/src/lib/login-error.ts
@@ -1,5 +1,5 @@
import { ApiRequestError } from "@edgeever/client";
-import { translateMobileText } from "./mobile-locale";
+import { translateMobileText, getMobileCatalog, formatMobileCopy } from "./mobile-locale";
export type MobileLoginLocale = "zh-CN" | "en-US" | "ja" | "pl" | "ru";
@@ -12,60 +12,54 @@ const appendDiagnostics = (
) => `${message}\n${diagnosticCode}${rayId ? ` · Ray ID: ${rayId}` : ""}`;
export const formatMobileLoginError = (error: unknown, locale: MobileLoginLocale) => {
- const english = locale !== "zh-CN";
-
if (error instanceof ApiRequestError) {
const rayId = error.responseDiagnostics?.rayId;
if (error.responseDiagnostics?.cloudflareMitigated) {
return appendDiagnostics(
- english
- ? "A Cloudflare browser challenge intercepted the login API. Ask the instance administrator to adjust the WAF Challenge rule for the API."
- : "Cloudflare 人机验证拦截了登录接口。请实例管理员调整针对 API 的 WAF Challenge 规则。",
+ getMobileCatalog(locale).mobile.login.cloudflareChallenge,
"cloudflare_challenge",
rayId,
);
}
if (error.code === "auth_not_configured") {
return appendDiagnostics(
- english ? "Sign-in is not configured for this instance." : "这个实例还没有配置登录功能。",
+ getMobileCatalog(locale).mobile.login.authNotConfigured,
"auth_not_configured",
rayId,
);
}
if (error.code === "database_not_ready") {
return appendDiagnostics(
- english ? "The instance database is not ready." : "实例数据库尚未就绪。",
+ getMobileCatalog(locale).mobile.login.databaseNotReady,
"database_not_ready",
rayId,
);
}
if (error.code === "password_hash_invalid") {
return appendDiagnostics(
- english ? "The instance password configuration is invalid." : "实例的密码配置无效。",
+ getMobileCatalog(locale).mobile.login.invalidPasswordConfig,
"password_hash_invalid",
rayId,
);
}
if (error.code === "login_rate_limited" || error.status === 429) {
return appendDiagnostics(
- english ? "Too many sign-in attempts. Try again later." : "登录尝试次数过多,请稍后再试。",
+ getMobileCatalog(locale).mobile.login.rateLimited,
"login_rate_limited",
rayId,
);
}
if (error.code === "unauthorized" || error.status === 401) {
return appendDiagnostics(
- english ? "The username or password is incorrect." : "用户名或密码不正确。",
+ getMobileCatalog(locale).mobile.login.invalidCredentials,
"invalid_credentials",
rayId,
);
}
if (error.status === 404) {
return appendDiagnostics(
- english
- ? "No EdgeEver API was found at this instance address."
- : "该实例地址没有找到 EdgeEver API,请检查地址。",
+ getMobileCatalog(locale).mobile.login.apiNotFound,
"edgeever_api_not_found",
rayId,
);
@@ -74,27 +68,21 @@ export const formatMobileLoginError = (error: unknown, locale: MobileLoginLocale
const isEdgeEverApiError = error.responseDiagnostics?.isEdgeEverApiError;
return appendDiagnostics(
isEdgeEverApiError
- ? (english ? "The instance rejected the login request." : "实例拒绝了登录请求。")
- : (english
- ? "A security policy blocked the request before it reached EdgeEver. Check Cloudflare Security Events, Access, WAF, or reverse-proxy rules."
- : "登录请求在到达 EdgeEver 前被安全策略拦截。请检查 Cloudflare Security Events、Access、WAF 或反向代理规则。"),
+ ? getMobileCatalog(locale).mobile.login.loginRejected
+ : getMobileCatalog(locale).mobile.login.securityPolicyBlocked,
isEdgeEverApiError ? error.code || "http_403" : "security_policy_blocked",
rayId,
);
}
if (error.status >= 500) {
return appendDiagnostics(
- english
- ? `The instance returned a server error (HTTP ${error.status}).`
- : `实例服务异常(HTTP ${error.status})。`,
+ formatMobileCopy(getMobileCatalog(locale).mobile.login.serverError, { status: error.status }),
`http_${error.status}`,
rayId,
);
}
return appendDiagnostics(
- english
- ? `The instance rejected the request (HTTP ${error.status}).`
- : `实例拒绝了请求(HTTP ${error.status})。`,
+ formatMobileCopy(getMobileCatalog(locale).mobile.login.requestRejected, { status: error.status }),
error.code || `http_${error.status}`,
rayId,
);
@@ -106,24 +94,20 @@ export const formatMobileLoginError = (error: unknown, locale: MobileLoginLocale
if (error instanceof TypeError) {
return appendDiagnostics(
- english
- ? "Unable to reach the instance. Check its address and your network connection."
- : "无法连接实例,请检查实例地址和网络连接。",
+ getMobileCatalog(locale).mobile.login.unreachable,
"network_unreachable",
);
}
if (error instanceof SyntaxError) {
return appendDiagnostics(
- english
- ? "The server response is not a valid EdgeEver response."
- : "服务端返回的内容不是有效的 EdgeEver 响应。",
+ getMobileCatalog(locale).mobile.login.invalidResponse,
"invalid_instance_response",
);
}
return appendDiagnostics(
- english ? "Sign-in failed. Try again later." : "登录失败,请稍后再试。",
+ getMobileCatalog(locale).mobile.login.failed,
"unexpected_login_error",
);
};
diff --git a/apps/mobile/src/lib/mobile-locale.test.mjs b/apps/mobile/src/lib/mobile-locale.test.mjs
index 0a007a96..6b62eb45 100644
--- a/apps/mobile/src/lib/mobile-locale.test.mjs
+++ b/apps/mobile/src/lib/mobile-locale.test.mjs
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
-import { localizeMissingNotebookName, localizeUntitledMemoTitle, toMobileSyncErrorSourceText, translateMobileText } from "./mobile-locale.tsx";
+import { formatMobileCopy, getMobileCatalog, localizeMissingNotebookName, localizeUntitledMemoTitle, toMobileSyncErrorSourceText, translateMobileText } from "./mobile-locale.tsx";
describe("mobile locale translation", () => {
test("keeps Chinese copy unchanged for the Chinese locale", () => {
@@ -104,6 +104,24 @@ describe("mobile locale translation", () => {
expect(localizeMissingNotebookName("zh-CN")).toBe("未分类");
});
+ test("translates accessibility label templates for every locale", () => {
+ expect(translateMobileText("编辑笔记标题:Plan", "pl")).toBe("Edytuj tytuł notatki: Plan");
+ expect(translateMobileText("新建标签 praca", "pl")).toBe("Utwórz tag praca");
+ expect(translateMobileText("标签 praca", "en-US")).toBe("Tag praca");
+ expect(translateMobileText("Ustawienia,发现新版本", "pl")).toBe("Ustawienia, dostępna aktualizacja");
+ expect(translateMobileText("新建标签 x", "ja")).toBe("タグ x を作成");
+ });
+
+ test("reads native copy from the shared catalog for every locale", () => {
+ expect(getMobileCatalog("pl").mobile.update.title).toBe("Aktualizacje aplikacji");
+ expect(getMobileCatalog("ja").mobile.update.title).toBe("アプリのアップデート");
+ expect(getMobileCatalog("en-US").mobile.update.title).toBe("App updates");
+ expect(getMobileCatalog("zh-CN").mobile.update.title).toBe("应用更新");
+ expect(formatMobileCopy(getMobileCatalog("pl").mobile.login.serverError, { status: 503 }))
+ .toBe("Instancja zwróciła błąd serwera (HTTP 503).");
+ expect(formatMobileCopy("{{known}} {{missing}}", { known: "a" })).toBe("a {{missing}}");
+ });
+
test("localizes the suspicious overwrite sync error the server reports in English", () => {
const source = toMobileSyncErrorSourceText("Save blocked because the title changed while most of the note content disappeared.");
expect(translateMobileText(source, "pl")).toStartWith("Zapis zablokowany");
diff --git a/apps/mobile/src/lib/mobile-locale.tsx b/apps/mobile/src/lib/mobile-locale.tsx
index 2f45fd56..be2e8bdb 100644
--- a/apps/mobile/src/lib/mobile-locale.tsx
+++ b/apps/mobile/src/lib/mobile-locale.tsx
@@ -9,6 +9,7 @@ import {
} from "./preferences";
type SupportedMobileLocale = "zh-CN" | "en-US" | "ja" | "pl" | "ru";
+export type MobileLocale = SupportedMobileLocale;
type MobileLocaleContextValue = {
preference: MobileLocalePreference;
resolvedLocale: SupportedMobileLocale;
@@ -251,6 +252,11 @@ const mobileOnlyTranslations = new Map<string, string>([
["无法保存剪藏", "Unable to save clip"],
["剪藏失败", "Could not clip the page"],
["无法读取分享的网页,请稍后重试。", "Could not read the shared page. Try again later."],
+ ["编辑笔记标题:{{title}}", "Edit note title: {{title}}"],
+ ["新建标签 {{name}}", "Create tag {{name}}"],
+ ["标签 {{name}}", "Tag {{name}}"],
+ ["{{label}},发现新版本", "{{label}}, update available"],
+ ["附件读取不完整,请重新选择文件", "The attachment could not be read completely. Choose the file again."],
]);
const mobileOnlyJapanese = new Map<string, string>([
@@ -485,6 +491,11 @@ const mobileOnlyJapanese = new Map<string, string>([
["无法保存剪藏", "クリップを保存できませんでした"],
["剪藏失败", "ページを取り込めませんでした"],
["无法读取分享的网页,请稍后重试。", "共有されたページを読み取れませんでした。しばらくしてから再試行してください。"],
+ ["编辑笔记标题:{{title}}", "ノートのタイトルを編集: {{title}}"],
+ ["新建标签 {{name}}", "タグ {{name}} を作成"],
+ ["标签 {{name}}", "タグ {{name}}"],
+ ["{{label}},发现新版本", "{{label}}、アップデートがあります"],
+ ["附件读取不完整,请重新选择文件", "添付ファイルを最後まで読み込めませんでした。ファイルを選び直してください。"],
]);
const mobileOnlyPolish = new Map<string, string>([
@@ -719,6 +730,11 @@ const mobileOnlyPolish = new Map<string, string>([
["无法保存剪藏", "Nie można zapisać wycinka"],
["剪藏失败", "Nie udało się zapisać strony"],
["无法读取分享的网页,请稍后重试。", "Nie udało się odczytać udostępnionej strony. Spróbuj ponownie później."],
+ ["编辑笔记标题:{{title}}", "Edytuj tytuł notatki: {{title}}"],
+ ["新建标签 {{name}}", "Utwórz tag {{name}}"],
+ ["标签 {{name}}", "Tag {{name}}"],
+ ["{{label}},发现新版本", "{{label}}, dostępna aktualizacja"],
+ ["附件读取不完整,请重新选择文件", "Nie udało się odczytać całego załącznika. Wybierz plik ponownie."],
]);
const flattenStrings = (value: unknown, prefix = "", output = new Map<string, string>()) => {
@@ -801,9 +817,20 @@ const polishTemplateTranslations = [
...mobilePolishTemplateTranslations,
...plTranslationPairs.filter((pair) => pair.pattern),
].sort((left, right) => right.source.length - left.source.length);
-const russianTemplateTranslations = [
- ...ruTranslationPairs.filter((pair) => pair.pattern),
-].sort((left, right) => right.source.length - left.source.length);
+const russianTemplateTranslations = ruTranslationPairs
+ .filter((pair) => pair.pattern)
+ .sort((left, right) => right.source.length - left.source.length);
+
+type LocalizedCatalog<T> = { readonly [K in keyof T]: T[K] extends string ? string : LocalizedCatalog<T[K]> };
+export type MobileCatalog = LocalizedCatalog<typeof enUS>;
+
+// Typing every locale against the English shape makes a missing key a compile error.
+const mobileCatalogs: Record<SupportedMobileLocale, MobileCatalog> = { "zh-CN": zhCN, "en-US": enUS, ja, pl, ru };
+
+export const getMobileCatalog = (locale: SupportedMobileLocale): MobileCatalog => mobileCatalogs[locale];
+
+export const formatMobileCopy = (template: string, values: Record<string, string | number>) =>
+ template.replace(/\{\{(\w+)\}\}/g, (match, name: string) => (name in values ? String(values[name]) : match));
const resolveSystemLocale = (): SupportedMobileLocale =>
resolveSupportedLocale(Intl.DateTimeFormat().resolvedOptions().locale);
diff --git a/apps/mobile/src/lib/mobile-release.test.ts b/apps/mobile/src/lib/mobile-release.test.ts
index 4795b0b0..d5e8ee4b 100644
--- a/apps/mobile/src/lib/mobile-release.test.ts
+++ b/apps/mobile/src/lib/mobile-release.test.ts
@@ -77,14 +77,10 @@ test("offers Google Play and the latest GitHub Release as manual update destinat
applicationId: ANDROID_APPLICATION_ID,
fallbackUrl: GOOGLE_PLAY_WEB_URL,
id: "google-play",
- labelEn: "Update on Google Play",
- labelZh: "在 Google Play 更新",
url: GOOGLE_PLAY_APP_URL,
},
{
id: "github",
- labelEn: "Download from GitHub",
- labelZh: "从 GitHub 下载",
url: GITHUB_LATEST_RELEASE_URL,
},
]);
diff --git a/apps/mobile/src/lib/mobile-release.ts b/apps/mobile/src/lib/mobile-release.ts
index 76566e27..1e38712b 100644
--- a/apps/mobile/src/lib/mobile-release.ts
+++ b/apps/mobile/src/lib/mobile-release.ts
@@ -8,8 +8,6 @@ export const GOOGLE_PLAY_APP_URL = "market://details?id=org.edgeever.mobile";
export const GOOGLE_PLAY_WEB_URL = "https://play.google.com/store/apps/details?id=org.edgeever.mobile";
type MobileInstallUpdateSourceBase = {
- labelEn: string;
- labelZh: string;
url: string;
};
@@ -29,14 +27,10 @@ export const ANDROID_INSTALL_UPDATE_SOURCES: readonly MobileInstallUpdateSource[
applicationId: ANDROID_APPLICATION_ID,
fallbackUrl: GOOGLE_PLAY_WEB_URL,
id: "google-play",
- labelEn: "Update on Google Play",
- labelZh: "在 Google Play 更新",
url: GOOGLE_PLAY_APP_URL,
},
{
id: "github",
- labelEn: "Download from GitHub",
- labelZh: "从 GitHub 下载",
url: GITHUB_LATEST_RELEASE_URL,
},
];
diff --git a/apps/mobile/src/lib/mobile-update.tsx b/apps/mobile/src/lib/mobile-update.tsx
index 8537072d..c1e08850 100644
--- a/apps/mobile/src/lib/mobile-update.tsx
+++ b/apps/mobile/src/lib/mobile-update.tsx
@@ -5,7 +5,7 @@ import * as Updates from "expo-updates";
import { Alert } from "../components/LocalizedText";
import { googlePlayUpdates, openGooglePlayDetails } from "../../modules/edgeever-app-store";
import { MobilePlayUpdate } from "./mobile-play-update";
-import { useMobileLocale } from "./mobile-locale";
+import { useMobileLocale, getMobileCatalog, formatMobileCopy } from "./mobile-locale";
import {
ANDROID_INSTALL_UPDATE_SOURCES,
findNewerMobileRelease,
@@ -62,15 +62,14 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
setStatus(state.status);
}), []);
const isSupported = !__DEV__ && (Platform.OS === "android" || Updates.isEnabled);
- const english = resolvedLocale !== "zh-CN";
const installedVersion = Updates.runtimeVersion ?? Constants.expoConfig?.version ?? null;
const showLinkError = useCallback(() => {
Alert.alert(
- english ? "Could not open link" : "无法打开链接",
- english ? "Check your browser settings and try again." : "请检查浏览器设置后重试。"
+ getMobileCatalog(resolvedLocale).mobile.update.linkOpenFailed,
+ getMobileCatalog(resolvedLocale).mobile.update.linkOpenFailedHint
);
- }, [english]);
+ }, [resolvedLocale]);
const openManualUpdateSource = useCallback((source: MobileInstallUpdateSource) => {
void openMobileInstallUpdateSource(source, {
@@ -82,34 +81,28 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
}
if (result.reason === "not-installed") {
Alert.alert(
- english ? "Google Play is not installed" : "未安装 Google Play",
- english
- ? "Google Play Store is not installed on this device, so this update channel is unavailable."
- : "这台设备未安装 Google Play 商店,无法通过该渠道更新。"
+ getMobileCatalog(resolvedLocale).mobile.update.playNotInstalled,
+ getMobileCatalog(resolvedLocale).mobile.update.playNotInstalledHint
);
return;
}
const { fallbackUrl, reason } = result;
const copy = reason === "disabled"
? {
- message: english
- ? "Google Play Store is disabled. Enable it in system settings, or open the web listing instead."
- : "Google Play 商店已被停用,请先在系统设置中启用,或改用网页版。",
- title: english ? "Google Play is disabled" : "Google Play 已停用",
+ message: getMobileCatalog(resolvedLocale).mobile.update.playDisabledHint,
+ title: getMobileCatalog(resolvedLocale).mobile.update.playDisabled,
}
: {
- message: english
- ? "Google Play Store could not handle this update link. Try again later, or open the web listing instead."
- : "Google Play 商店无法处理这个更新链接,请稍后重试,或改用网页版。",
- title: english ? "Could not open Google Play" : "无法打开 Google Play",
+ message: getMobileCatalog(resolvedLocale).mobile.update.playUnavailableHint,
+ title: getMobileCatalog(resolvedLocale).mobile.update.playUnavailable,
};
Alert.alert(copy.title, copy.message, [
{
- text: english ? "Cancel" : "取消",
+ text: getMobileCatalog(resolvedLocale).common.cancel,
style: "cancel",
},
{
- text: english ? "Open web listing" : "打开网页版",
+ text: getMobileCatalog(resolvedLocale).mobile.update.openWebListing,
onPress: () => {
void Linking.openURL(fallbackUrl).catch(showLinkError);
},
@@ -118,7 +111,7 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
}).catch(() => {
showLinkError();
});
- }, [english, showLinkError]);
+ }, [resolvedLocale, showLinkError]);
const openInstallUpdateOptions = useCallback((release: MobileRelease | null) => {
const googlePlay = ANDROID_INSTALL_UPDATE_SOURCES.find((source) => source.id === "google-play");
@@ -127,30 +120,28 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
return;
}
Alert.alert(
- english ? "Update available" : "发现新版本",
+ getMobileCatalog(resolvedLocale).mobile.update.available,
!release
- ? (english ? "Choose where to check for an app update." : "请选择检查应用更新的渠道。")
- : (english
- ? `EdgeEver ${release.version} is available. Choose where to update.`
- : `EdgeEver ${release.version} 已发布,请选择更新渠道。`),
+ ? getMobileCatalog(resolvedLocale).mobile.update.chooseSourceHint
+ : formatMobileCopy(getMobileCatalog(resolvedLocale).mobile.update.releaseAvailable, { version: release.version }),
[
{
- text: english ? "Later" : "稍后",
+ text: getMobileCatalog(resolvedLocale).mobile.update.later,
style: "cancel",
},
{
icon: "github",
- text: english ? github.labelEn : github.labelZh,
+ text: getMobileCatalog(resolvedLocale).mobile.update.sources[github.id],
onPress: () => openManualUpdateSource(github),
},
{
icon: "google-play",
- text: english ? googlePlay.labelEn : googlePlay.labelZh,
+ text: getMobileCatalog(resolvedLocale).mobile.update.sources[googlePlay.id],
onPress: () => openManualUpdateSource(googlePlay),
},
]
);
- }, [english, openManualUpdateSource]);
+ }, [resolvedLocale, openManualUpdateSource]);
const runCheck = useCallback((userInitiated: boolean) => {
if (activeCheckRef.current) {
@@ -160,10 +151,8 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
if (!isSupported) {
if (userInitiated) {
Alert.alert(
- english ? "Updates unavailable" : "暂无法检查更新",
- english
- ? "Update checks are available in installed release builds, not Expo Go or development builds."
- : "检查更新仅适用于已安装的正式版,Expo Go 和开发版暂不支持。"
+ getMobileCatalog(resolvedLocale).mobile.update.unsupported,
+ getMobileCatalog(resolvedLocale).mobile.update.unsupportedHint
);
}
return Promise.resolve();
@@ -224,19 +213,19 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
activeCheckRef.current = null;
});
return check;
- }, [english, installedVersion, isSupported, playUpdate]);
+ }, [resolvedLocale, installedVersion, isSupported, playUpdate]);
const completePlayUpdate = useCallback(async () => {
if (await googlePlayUpdates.complete()) return;
Alert.alert(
- english ? "Could not install update" : "无法安装更新",
- english ? "Try again, or use an existing update channel." : "请重试,或使用现有更新渠道。",
+ getMobileCatalog(resolvedLocale).mobile.update.installFailed,
+ getMobileCatalog(resolvedLocale).mobile.update.installFailedHint,
[
- { text: english ? "Later" : "稍后", style: "cancel" },
- { text: english ? "Choose update source" : "选择更新渠道", onPress: () => openInstallUpdateOptions(installRelease) },
+ { text: getMobileCatalog(resolvedLocale).mobile.update.later, style: "cancel" },
+ { text: getMobileCatalog(resolvedLocale).mobile.update.chooseSource, onPress: () => openInstallUpdateOptions(installRelease) },
]
);
- }, [english, installRelease, openInstallUpdateOptions]);
+ }, [resolvedLocale, installRelease, openInstallUpdateOptions]);
useEffect(() => {
if (Platform.OS !== "android" || !isSupported) return;
@@ -249,14 +238,14 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
if (updateKind !== "play" || status !== "ready" || readyPromptVersionRef.current === playUpdate.state.versionCode) return;
readyPromptVersionRef.current = playUpdate.state.versionCode;
Alert.alert(
- english ? "Update ready" : "更新已就绪",
- english ? "Restart now to install the Google Play update, or continue using the app." : "重启即可安装 Google Play 更新,也可以稍后继续使用。",
+ getMobileCatalog(resolvedLocale).mobile.update.ready,
+ getMobileCatalog(resolvedLocale).mobile.update.playReadyHint,
[
- { text: english ? "Later" : "稍后", style: "cancel" },
- { text: english ? "Restart" : "立即重启", onPress: () => { void completePlayUpdate(); } },
+ { text: getMobileCatalog(resolvedLocale).mobile.update.later, style: "cancel" },
+ { text: getMobileCatalog(resolvedLocale).mobile.update.restart, onPress: () => { void completePlayUpdate(); } },
]
);
- }, [completePlayUpdate, english, playUpdate, status, updateKind]);
+ }, [completePlayUpdate, resolvedLocale, playUpdate, status, updateKind]);
useEffect(() => {
const attemptAutomaticCheck = () => {
@@ -319,25 +308,24 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
if (!result.isNew) {
setUpdateKind(null);
setStatus("idle");
- if (english) {
- Alert.alert("No update", "No downloadable in-app update was found.");
- } else {
- Alert.alert("暂无更新", "没有可下载的应用内更新。");
- }
+ Alert.alert(
+ getMobileCatalog(resolvedLocale).mobile.update.none,
+ getMobileCatalog(resolvedLocale).mobile.update.noneHint,
+ );
return;
}
setStatus("ready");
Alert.alert(
- english ? "Update ready" : "更新已就绪",
- english ? "Restart now to apply the update." : "重启后即可应用更新。",
+ getMobileCatalog(resolvedLocale).mobile.update.ready,
+ getMobileCatalog(resolvedLocale).mobile.update.readyHint,
[
{
- text: english ? "Later" : "稍后",
+ text: getMobileCatalog(resolvedLocale).mobile.update.later,
style: "cancel",
},
{
- text: english ? "Restart" : "立即重启",
+ text: getMobileCatalog(resolvedLocale).mobile.update.restart,
onPress: () => {
void Updates.reloadAsync();
},
@@ -347,13 +335,11 @@ export const MobileUpdateProvider = ({ children }: { children: ReactNode }) => {
} catch {
setStatus("available");
Alert.alert(
- english ? "Update failed" : "更新失败",
- english
- ? "Could not download the in-app update. Try again later."
- : "无法下载应用内更新,请稍后再试。"
+ getMobileCatalog(resolvedLocale).mobile.update.failed,
+ getMobileCatalog(resolvedLocale).mobile.update.failedHint
);
}
- }, [completePlayUpdate, english, installRelease, isSupported, openInstallUpdateOptions, playUpdate, status, updateKind]);
+ }, [completePlayUpdate, resolvedLocale, installRelease, isSupported, openInstallUpdateOptions, playUpdate, status, updateKind]);
const hasUpdate = status === "available" || status === "ready" || status === "downloading";
const value = useMemo<MobileUpdateContextValue>(
diff --git a/apps/mobile/src/lib/note-image-font-options.ts b/apps/mobile/src/lib/note-image-font-options.ts
index 70123b41..5535ce79 100644
--- a/apps/mobile/src/lib/note-image-font-options.ts
+++ b/apps/mobile/src/lib/note-image-font-options.ts
@@ -1,28 +1,32 @@
-import { zhCN, enUS } from "@edgeever/shared/i18n";
+import type { enUS } from "@edgeever/shared/i18n";
import { FONT_CATALOG, FONT_IDS } from "@edgeever/shared/font-catalog";
import { NOTE_IMAGE_TEMPLATE_TYPOGRAPHY, resolveTheme, type NoteImageTheme, type NoteImageFontStyle } from "@edgeever/shared/note-image-card";
-export const MOBILE_FONT_OPTIONS: Array<{ id: NoteImageFontStyle; labelZh: string; labelEn: string }> = [
- { id: "auto", labelZh: "跟随主题", labelEn: "Follow Theme" },
- { id: "kai", labelZh: "文楷手书", labelEn: "Handwritten Kai" },
- { id: "serif", labelZh: "文艺衬线", labelEn: "Serif" },
- { id: "sans", labelZh: "现代无衬线", labelEn: "Sans" },
- { id: "mono", labelZh: "极客等宽", labelEn: "Mono" },
- ...FONT_IDS.map(id => ({ id, labelZh: FONT_CATALOG[id].zh, labelEn: FONT_CATALOG[id].en })),
+type ImageShareCopy = typeof enUS.editor.imageShare;
+type FontStyleLabelKey = keyof ImageShareCopy["fontStyles"];
+
+/** Labels from the resolved locale's `editor.imageShare` catalog. */
+export type NoteImageFontLabels = {
+ readonly fontStyles: { readonly [K in FontStyleLabelKey]: string };
+ readonly templateFonts: { readonly [K in keyof ImageShareCopy["templateFonts"]]: string };
+};
+
+export const MOBILE_FONT_OPTIONS: Array<{ id: NoteImageFontStyle; labelKey: FontStyleLabelKey }> = [
+ ...(["auto", "kai", "serif", "sans", "mono"] as const).map((id) => ({ id, labelKey: id })),
+ ...FONT_IDS.map(id => ({ id, labelKey: FONT_CATALOG[id].labelKey.split(".").pop() as FontStyleLabelKey })),
];
export const getMobileNoteImageFontLabel = (
fontStyle: NoteImageFontStyle,
theme: NoteImageTheme,
- chinese: boolean,
+ labels: NoteImageFontLabels,
includeFollowTheme = false,
): string => {
const option = MOBILE_FONT_OPTIONS.find(item => item.id === fontStyle);
- const label = option?.[chinese ? "labelZh" : "labelEn"] ?? "";
+ const label = option ? labels.fontStyles[option.labelKey] : "";
if (fontStyle !== "auto") return label;
- const labels = (chinese ? zhCN : enUS).editor.imageShare.templateFonts;
const themeFontLabel = NOTE_IMAGE_TEMPLATE_TYPOGRAPHY[resolveTheme(undefined, theme)].body
- .map(font => labels[font])
+ .map(font => labels.templateFonts[font])
.join(" / ");
return includeFollowTheme ? `${label} (${themeFontLabel})` : themeFontLabel;
};
diff --git a/apps/mobile/src/screens/WorkspaceEditors.tsx b/apps/mobile/src/screens/WorkspaceEditors.tsx
index efcdf053..621435de 100644
--- a/apps/mobile/src/screens/WorkspaceEditors.tsx
+++ b/apps/mobile/src/screens/WorkspaceEditors.tsx
@@ -22,7 +22,7 @@ import {
writeMobileMemoDraft,
type MobileMemoDraft,
} from "../lib/mobile-drafts";
-import { localizeMissingNotebookName, useMobileLocale } from "../lib/mobile-locale";
+import { localizeMissingNotebookName, useMobileLocale, getMobileCatalog, formatMobileCopy } from "../lib/mobile-locale";
import { useSession } from "../lib/session";
import { queueMobileMemoCreate, queueMobileMemoUpdate } from "../lib/sync-queue";
import { createMobileDataScope, upsertLocalMemo } from "../lib/local-mirror";
@@ -133,14 +133,10 @@ const alertProtectedImageLoadFailure = (
) => {
const statusLabel = failure.status != null
? String(failure.status)
- : locale !== "zh-CN"
- ? "network error"
- : "网络错误";
+ : getMobileCatalog(locale).mobile.common.networkError;
Alert.alert(
- locale !== "zh-CN" ? "Image failed to load" : "图片加载失败",
- locale !== "zh-CN"
- ? `Could not load a note image (${statusLabel}). Check the network and try again.`
- : `笔记中的图片未能加载(${statusLabel})。请检查网络后重试。`
+ getMobileCatalog(locale).mobile.common.imageLoadFailed,
+ formatMobileCopy(getMobileCatalog(locale).mobile.common.noteImageLoadFailed, { status: statusLabel })
);
};
diff --git a/apps/mobile/src/screens/WorkspaceMemoDetail.tsx b/apps/mobile/src/screens/WorkspaceMemoDetail.tsx
index 4a398481..e6a087d4 100644
--- a/apps/mobile/src/screens/WorkspaceMemoDetail.tsx
+++ b/apps/mobile/src/screens/WorkspaceMemoDetail.tsx
@@ -38,7 +38,7 @@ import {
saveMobileResourceAs,
type MobileResourceTarget,
} from "../lib/mobile-attachments";
-import { localizeUntitledMemoTitle, useMobileLocale } from "../lib/mobile-locale";
+import { localizeUntitledMemoTitle, useMobileLocale, getMobileCatalog, formatMobileCopy } from "../lib/mobile-locale";
import {
createOnceProtectedResourceFailureNotifier,
isProtectedResourceSource,
@@ -168,12 +168,10 @@ const alertProtectedImageLoadFailure = (
locale: "zh-CN" | "en-US" | "ja" | "pl" | "ru",
failure: ProtectedResourceLoadFailure
) => {
- const statusLabel = failure.status != null ? String(failure.status) : locale !== "zh-CN" ? "network error" : "网络错误";
+ const statusLabel = failure.status != null ? String(failure.status) : getMobileCatalog(locale).mobile.common.networkError;
Alert.alert(
- locale !== "zh-CN" ? "Image failed to load" : "图片加载失败",
- locale !== "zh-CN"
- ? `Could not load a note image (${statusLabel}). Check the network and try again.`
- : `笔记中的图片未能加载(${statusLabel})。请检查网络后重试。`
+ getMobileCatalog(locale).mobile.common.imageLoadFailed,
+ formatMobileCopy(getMobileCatalog(locale).mobile.common.noteImageLoadFailed, { status: statusLabel })
);
};
@@ -223,24 +221,11 @@ const loadAuthenticatedSvg = (source: AuthenticatedImageSource) => {
return pending;
};
-const MOBILE_THEME_LABELS = {
- "glass": { labelZh: "透明", labelEn: "Glass" },
- "quote": { labelZh: "金句", labelEn: "Quote" },
- "book": { labelZh: "书摘", labelEn: "Book excerpt" },
- "memo": { labelZh: "备忘录", labelEn: "Memo" },
- "bento": { labelZh: "便当", labelEn: "Bento" },
- "black-sun": { labelZh: "黑日", labelEn: "Black Sun" },
- "frame": { labelZh: "框界", labelEn: "Frame" },
- "handwritten": { labelZh: "手写", labelEn: "Handwritten" },
- "code": { labelZh: "代码", labelEn: "Code" },
-};
-
const MOBILE_THEME_OPTIONS = NOTE_IMAGE_THEME_OPTIONS.map((id) => ({
- id, ...MOBILE_THEME_LABELS[id], previewBg: NOTE_IMAGE_BACKGROUND_COLORS[id],
+ id, previewBg: NOTE_IMAGE_BACKGROUND_COLORS[id],
}));
-
const AuthenticatedResourceImage = ({
alt,
fitAspect = false,
@@ -534,7 +519,7 @@ export const MemoDetailModal = ({
showNotebook: imageShareNotebook, showTags: imageShareTags, showUpdatedAt: imageShareUpdatedAt,
showBranding: imageShareBranding,
} = imageSharePreferences;
- const imageShareFontLabel = getMobileNoteImageFontLabel(imageShareFontStyle, imageShareTheme, resolvedLocale === "zh-CN");
+ const imageShareFontLabel = getMobileNoteImageFontLabel(imageShareFontStyle, imageShareTheme, getMobileCatalog(resolvedLocale).editor.imageShare);
const [viewerNotebookPickerOpen, setViewerNotebookPickerOpen] = useState(false);
const [viewerTagsOpen, setViewerTagsOpen] = useState(false);
const [viewerTags, setViewerTags] = useState<string[]>([]);
@@ -615,13 +600,13 @@ export const MemoDetailModal = ({
});
const downloadResource = useCallback(async (target: MobileResourceTarget) => {
- if (!client) throw new Error(resolvedLocale !== "zh-CN" ? "The resource client is unavailable." : "当前无法读取资源。");
+ if (!client) throw new Error(getMobileCatalog(resolvedLocale).mobile.common.resourceUnavailable);
try {
await openMobileResource(client, target, { baseUrl, token: session?.token });
} catch (error) {
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Unable to open resource" : "无法打开资源",
- error instanceof Error ? error.message : (resolvedLocale !== "zh-CN" ? "Try again later." : "请稍后重试。")
+ getMobileCatalog(resolvedLocale).mobile.memoDetail.openResourceFailed,
+ error instanceof Error ? error.message : getMobileCatalog(resolvedLocale).mobile.common.tryAgainLater
);
throw error;
}
@@ -655,12 +640,12 @@ export const MemoDetailModal = ({
};
const saveResourceAs = useCallback(async (target: MobileResourceTarget) => {
- if (!client) throw new Error(resolvedLocale !== "zh-CN" ? "The resource client is unavailable." : "当前无法读取资源。");
+ if (!client) throw new Error(getMobileCatalog(resolvedLocale).mobile.common.resourceUnavailable);
const result = await saveMobileResourceAs(client, target, { baseUrl, token: session?.token });
if (result.kind === "saf") {
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Downloaded" : "下载成功",
- resolvedLocale !== "zh-CN" ? `Saved ${result.filename}` : `已保存:${result.filename}`
+ getMobileCatalog(resolvedLocale).mobile.common.downloaded,
+ formatMobileCopy(getMobileCatalog(resolvedLocale).mobile.common.savedFile, { filename: result.filename })
);
}
}, [baseUrl, client, resolvedLocale, session?.token]);
@@ -869,13 +854,13 @@ export const MemoDetailModal = ({
try {
await Clipboard.setStringAsync(memo.id);
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Note ID copied" : "笔记 ID 已复制",
+ getMobileCatalog(resolvedLocale).mobile.memoDetail.noteIdCopied,
memo.id
);
} catch {
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Could not copy note ID" : "复制笔记 ID 失败",
- resolvedLocale !== "zh-CN" ? "Please try again." : "请稍后重试。"
+ getMobileCatalog(resolvedLocale).mobile.memoDetail.noteIdCopyFailed,
+ getMobileCatalog(resolvedLocale).mobile.common.tryAgainLater
);
}
};
@@ -922,17 +907,13 @@ export const MemoDetailModal = ({
setIsExportingImage(false);
if (imageShareFromList) setImageShareOptionsOpen(true);
const localizedMessage = message === "NOTE_IMAGE_TOO_LONG"
- ? (resolvedLocale !== "zh-CN"
- ? "This note is too long for one readable image. Choose a smaller font size or split the note."
- : "这篇笔记太长,无法生成清晰的单张图片。请调小导出字号,或拆分笔记后重试。")
+ ? getMobileCatalog(resolvedLocale).mobile.imageShare.tooLong
: message === "NOTE_IMAGE_RENDER_FAILED"
- ? (resolvedLocale !== "zh-CN"
- ? "This image could not be rendered on this device. Try a smaller font size or a shorter note."
- : "这台设备无法渲染这张图片。请调小导出字号,或缩短笔记后重试。")
+ ? getMobileCatalog(resolvedLocale).mobile.imageShare.renderFailed
: message;
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Image export failed" : "导出笔记图片失败",
- localizedMessage || (resolvedLocale !== "zh-CN" ? "Try again later." : "请稍后重试。")
+ getMobileCatalog(resolvedLocale).mobile.imageShare.exportFailed,
+ localizedMessage || getMobileCatalog(resolvedLocale).mobile.common.tryAgainLater
);
}, [clearImageExportTimeout, imageShareFromList, resolvedLocale]);
@@ -991,7 +972,7 @@ export const MemoDetailModal = ({
setPreparedNoteImage(prepared);
} else {
setIsExportingImage(false);
- if (!(await Sharing.isAvailableAsync())) throw new Error(resolvedLocale !== "zh-CN" ? "Sharing is unavailable on this device." : "当前设备无法打开系统分享面板。");
+ if (!(await Sharing.isAvailableAsync())) throw new Error(getMobileCatalog(resolvedLocale).mobile.common.sharingUnavailable);
await Sharing.shareAsync(file.uri, {
dialogTitle: event.filename,
mimeType: event.mimeType,
@@ -999,8 +980,8 @@ export const MemoDetailModal = ({
}
} catch (error) {
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Image export failed" : "导出笔记图片失败",
- error instanceof Error ? error.message : (resolvedLocale !== "zh-CN" ? "Try again later." : "请稍后重试。")
+ getMobileCatalog(resolvedLocale).mobile.imageShare.exportFailed,
+ error instanceof Error ? error.message : getMobileCatalog(resolvedLocale).mobile.common.tryAgainLater
);
} finally {
imageExportChunksRef.current = [];
@@ -1034,7 +1015,7 @@ export const MemoDetailModal = ({
if (!memo || !viewerReady || isExportingImage || imageExportRequestRef.current !== null) return;
const viewer = viewerRef.current;
if (!viewer) {
- failImageExport(resolvedLocale !== "zh-CN" ? "The note viewer is not ready. Try again." : "笔记尚未准备好,请重试。");
+ failImageExport(getMobileCatalog(resolvedLocale).mobile.imageShare.viewerNotReady);
return;
}
const requestId = `${Date.now()}-${Math.random().toString(36).slice(2)}`;
@@ -1048,9 +1029,7 @@ export const MemoDetailModal = ({
setIsExportingImage(true);
imageExportTimeoutRef.current = setTimeout(() => {
if (imageExportRequestRef.current !== requestId) return;
- failImageExport(resolvedLocale !== "zh-CN"
- ? "Image generation timed out. Please try again."
- : "生成图片超时,请重试。");
+ failImageExport(getMobileCatalog(resolvedLocale).mobile.imageShare.timedOut);
setViewerReady(false);
setViewerGeneration((generation) => generation + 1);
}, IMAGE_EXPORT_TIMEOUT_MS);
@@ -1085,12 +1064,12 @@ export const MemoDetailModal = ({
const sharePreparedNoteImage = useCallback(async (prepared: MobilePreparedNoteImage) => {
try {
- if (!(await Sharing.isAvailableAsync())) throw new Error(resolvedLocale !== "zh-CN" ? "Sharing is unavailable on this device." : "当前设备无法打开系统分享面板。");
+ if (!(await Sharing.isAvailableAsync())) throw new Error(getMobileCatalog(resolvedLocale).mobile.common.sharingUnavailable);
await Sharing.shareAsync(prepared.uri, { dialogTitle: prepared.filename, mimeType: prepared.mimeType });
} catch (shareError) {
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Share failed" : "分享失败",
- shareError instanceof Error ? shareError.message : (resolvedLocale !== "zh-CN" ? "Try again later." : "请稍后重试。")
+ getMobileCatalog(resolvedLocale).mobile.memoDetail.shareFailed,
+ shareError instanceof Error ? shareError.message : getMobileCatalog(resolvedLocale).mobile.common.tryAgainLater
);
}
}, [resolvedLocale]);
@@ -1116,7 +1095,7 @@ export const MemoDetailModal = ({
encoding: FileSystem.EncodingType.Base64,
});
savedPath = getSavedImagePath(destination)
- ?? (resolvedLocale !== "zh-CN" ? `Selected folder / ${prepared.filename}` : `所选文件夹 / ${prepared.filename}`);
+ ?? formatMobileCopy(getMobileCatalog(resolvedLocale).mobile.imageShare.selectedFolder, { filename: prepared.filename });
} catch (saveError) {
if (destination) {
await FileSystem.StorageAccessFramework.deleteAsync(destination, { idempotent: true }).catch(() => {});
@@ -1124,10 +1103,10 @@ export const MemoDetailModal = ({
const message = saveError instanceof Error ? saveError.message : "";
const isUnwritableDirectory = /isn't writable|not writable|EACCES|Permission denied/i.test(message);
Alert.alert(
- resolvedLocale !== "zh-CN" ? "Save failed" : "保存失败",
+ getMobileCatalog(resolvedLocale).mobile.imageShare.saveFailed,
isUnwritableDirectory
- ? (resolvedLocale !== "zh-CN" ? "This folder cannot accept files. Choose a folder in internal storage, such as Pictures." : "此文件夹无法写入。请选择内部存储中的其他文件夹,例如“Pictures”。")
- : (message || (resolvedLocale !== "zh-CN" ? "Try again later." : "请稍后重试。"))
+ ? getMobileCatalog(resolvedLocale).mobile.imageShare.folderNotWritable
+ : (message || getMobileCatalog(resolvedLocale).mobile.common.tryAgainLater)
);
} finally {
setImageSavePickerOpen(false);
@@ -1524,7 +1503,7 @@ export const MemoDetailModal = ({
/>
) : (
<View style={styles.centerState}>
- <Text style={styles.errorText}>{resolvedLocale !== "zh-CN" ? "Not signed in." : "未登录。"}</Text>
+ <Text style={styles.errorText}>{getMobileCatalog(resolvedLocale).mobile.memoDetail.notSignedIn}</Text>
</View>
)}
{!viewerReady ? (
@@ -1557,18 +1536,18 @@ export const MemoDetailModal = ({
<Pressable onPress={() => setActionsOpen(false)} style={styles.actionSheetBackdrop}>
<Pressable style={styles.actionSheet}>
<View style={styles.actionSheetHandle} />
- <Text style={styles.actionSheetTitle}>{resolvedLocale !== "zh-CN" ? "Note actions" : "笔记操作"}</Text>
+ <Text style={styles.actionSheetTitle}>{getMobileCatalog(resolvedLocale).mobile.memoDetail.noteActions}</Text>
{!memo.isDeleted ? (
<>
<DetailActionSheetItem
disabled={isSharing}
icon={isSharing ? <ActivityIndicator color="#16A06E" size="small" /> : <Share2 color="#0f172a" size={18} />}
- label={resolvedLocale !== "zh-CN" ? "Share note" : "分享笔记"}
+ label={getMobileCatalog(resolvedLocale).mobile.memoDetail.shareNote}
onPress={() => closeActionsAndRun(() => onShare(memo))}
/>
<DetailActionSheetItem
icon={<History color="#0f172a" size={18} />}
- label={resolvedLocale !== "zh-CN" ? "Version history" : "版本历史"}
+ label={getMobileCatalog(resolvedLocale).editor.versionHistory}
onPress={() => closeActionsAndRun(() => onOpenRevisions(memo))}
/>
</>
@@ -1576,7 +1555,7 @@ export const MemoDetailModal = ({
{!memo.isDeleted && !locksRichTextEdit ? (
<DetailActionSheetItem
icon={<Sparkles color="#16A06E" size={18} />}
- label={resolvedLocale !== "zh-CN" ? "AI note assistant" : "AI 笔记助手"}
+ label={getMobileCatalog(resolvedLocale).aiAssistant.title}
onPress={() => closeActionsAndRun(() => setAiAssistantOpen(true))}
/>
) : null}
@@ -1584,28 +1563,28 @@ export const MemoDetailModal = ({
disabled={!canCopyMemoId}
icon={<Copy color="#0f172a" size={18} />}
label={canCopyMemoId
- ? (resolvedLocale !== "zh-CN" ? "Copy note ID" : "复制笔记 ID")
- : (resolvedLocale !== "zh-CN" ? "Copy note ID after sync" : "同步后可复制笔记 ID")}
+ ? getMobileCatalog(resolvedLocale).editor.copyNoteId
+ : getMobileCatalog(resolvedLocale).editor.copyNoteIdAfterSync}
onPress={() => closeActionsAndRun(() => void copyMemoId())}
/>
<DetailActionSheetItem
disabled={isExportingImage || !viewerReady || !imageSharePreferencesReady}
icon={isExportingImage ? <ActivityIndicator color="#16A06E" size="small" /> : <Share2 color="#0f172a" size={18} />}
label={isExportingImage
- ? (resolvedLocale !== "zh-CN" ? "Generating share image" : "正在生成分享图片")
- : (resolvedLocale !== "zh-CN" ? "Share as image" : "分享为图片")}
+ ? getMobileCatalog(resolvedLocale).mobile.imageShare.generating
+ : getMobileCatalog(resolvedLocale).editor.imageShare.title}
onPress={() => closeActionsAndRun(() => setImageShareOptionsOpen(true))}
/>
<DetailActionSheetItem
disabled={isExportingImage || !viewerReady || !imageSharePreferencesReady}
icon={<Download color="#0f172a" size={18} />}
- label={resolvedLocale !== "zh-CN" ? "Advanced export PNG" : "高级导出 PNG"}
+ label={getMobileCatalog(resolvedLocale).mobile.imageShare.advancedPng}
onPress={() => closeActionsAndRun(() => exportMemoImage("png"))}
/>
<DetailActionSheetItem
disabled={isExportingImage || !viewerReady || !imageSharePreferencesReady}
icon={<Download color="#0f172a" size={18} />}
- label={resolvedLocale !== "zh-CN" ? "Advanced export JPEG" : "高级导出 JPEG"}
+ label={getMobileCatalog(resolvedLocale).mobile.imageShare.advancedJpeg}
onPress={() => closeActionsAndRun(() => exportMemoImage("jpeg"))}
/>
{memo.isDeleted ? (
@@ -1627,8 +1606,8 @@ export const MemoDetailModal = ({
{preparedNoteImage ? (
<SafeAreaView style={imageShareStyles.previewSafeArea}>
<View style={imageShareStyles.previewHeader}>
- <Text style={imageShareStyles.previewTitle}>{resolvedLocale !== "zh-CN" ? "Image preview" : "图片预览"}</Text>
- <Pressable accessibilityLabel={resolvedLocale !== "zh-CN" ? "Close preview" : "关闭预览"} accessibilityRole="button" onPress={closeImagePreview} style={imageShareStyles.previewCloseButton}>
+ <Text style={imageShareStyles.previewTitle}>{getMobileCatalog(resolvedLocale).mobile.imageShare.preview}</Text>
+ <Pressable accessibilityLabel={getMobileCatalog(resolvedLocale).mobile.imageShare.closePreview} accessibilityRole="button" onPress={closeImagePreview} style={imageShareStyles.previewCloseButton}>
<X color="#0f172a" size={22} />
</Pressable>
</View>
@@ -1648,43 +1627,39 @@ export const MemoDetailModal = ({
/>
{preparedNoteImage.fontFallback || isExportingImage ? (
<View accessibilityLiveRegion="polite">
- <Text style={imageShareStyles.previewWarning}>{resolvedLocale === "zh-CN"
- ? isExportingImage ? "字体加载中…" : "暂时使用替代字体,加载成功后将自动恢复"
- : isExportingImage ? "Loading font…" : "Temporarily using substitute fonts. The original fonts will be restored automatically when loaded."}</Text>
+ <Text style={imageShareStyles.previewWarning}>{isExportingImage
+ ? getMobileCatalog(resolvedLocale).fontLoad.templateLoading
+ : getMobileCatalog(resolvedLocale).fontLoad.templateFallback}</Text>
{!isExportingImage ? <Pressable accessibilityRole="button" onPress={() => imageFontRecoveryRef.current?.retry()} style={imageShareStyles.previewSecondaryButton}>
- <Text>{resolvedLocale === "zh-CN" ? "重试" : "Retry"}</Text>
+ <Text>{getMobileCatalog(resolvedLocale).fontLoad.retry}</Text>
</Pressable> : null}
</View>
) : null}
{preparedNoteImage.failedImages > 0 ? (
<Text style={imageShareStyles.previewWarning}>
- {resolvedLocale !== "zh-CN"
- ? `${preparedNoteImage.failedImages} of ${preparedNoteImage.totalImages} note image(s) could not be included.`
- : `笔记中的 ${preparedNoteImage.totalImages} 张图片有 ${preparedNoteImage.failedImages} 张未能包含。`}
+ {formatMobileCopy(getMobileCatalog(resolvedLocale).mobile.imageShare.imagesOmitted, { failed: preparedNoteImage.failedImages, total: preparedNoteImage.totalImages })}
</Text>
) : null}
{preparedNoteImage.height > 12_000 ? (
<Text style={imageShareStyles.previewWarning}>
- {resolvedLocale !== "zh-CN"
- ? "This is a long image. Some social apps may reduce its quality; keep the saved original."
- : "图片较长,部分社交平台可能会压缩画质;建议保留保存的原图。"}
+ {getMobileCatalog(resolvedLocale).mobile.imageShare.longImageWarning}
</Text>
) : null}
</ScrollView>
<View style={imageShareStyles.previewActions}>
<Pressable accessibilityRole="button" onPress={() => void savePreparedNoteImage(preparedNoteImage)} style={imageShareStyles.previewSecondaryButton}>
<Download color="#0f172a" size={18} />
- <Text style={imageShareStyles.previewSecondaryButtonText}>{resolvedLocale !== "zh-CN" ? "Save" : "保存图片"}</Text>
+ <Text style={imageShareStyles.previewSecondaryButtonText}>{getMobileCatalog(resolvedLocale).mobile.imageShare.save}</Text>
</Pressable>
<Pressable accessibilityRole="button" onPress={() => void sharePreparedNoteImage(preparedNoteImage)} style={imageShareStyles.previewPrimaryButton}>
<Share2 color="#ffffff" size={18} />
- <Text style={imageShareStyles.previewPrimaryButtonText}>{resolvedLocale !== "zh-CN" ? "Share" : "系统分享"}</Text>
+ <Text style={imageShareStyles.previewPrimaryButtonText}>{getMobileCatalog(resolvedLocale).mobile.imageShare.share}</Text>
</Pressable>
</View>
{savedImagePath ? (
<View accessibilityLiveRegion="polite" pointerEvents="none" style={imageShareStyles.savedImageTipContainer}>
<View style={imageShareStyles.savedImageTip}>
- <Text style={imageShareStyles.savedImageTipTitle}>{resolvedLocale !== "zh-CN" ? "Saved to" : "图片已保存至"}</Text>
+ <Text style={imageShareStyles.savedImageTipTitle}>{getMobileCatalog(resolvedLocale).mobile.imageShare.savedTo}</Text>
<Text style={imageShareStyles.savedImageTipPath}>{savedImagePath}</Text>
</View>
</View>
@@ -1703,15 +1678,22 @@ export const MemoDetailModal = ({
{imageShareFontPickerOpen ? (
<View style={imageShareStyles.fontPicker}>
<View style={imageShareStyles.fontPickerHeader}>
- <Pressable accessibilityRole="button" accessibilityLabel={resolvedLocale === "zh-CN" ? "返回分享设置" : "Back to share settings"} onPress={() => setImageShareFontPickerOpen(false)} style={imageShareStyles.previewCloseButton}>
+ <Pressable accessibilityRole="button" accessibilityLabel={getMobileCatalog(resolvedLocale).mobile.imageShare.backToSettings} onPress={() => setImageShareFontPickerOpen(false)} style={imageShareStyles.previewCloseButton}>
<ChevronLeft color="#0f172a" size={22} />
</Pressable>
- <Text style={imageShareStyles.previewTitle}>{resolvedLocale === "zh-CN" ? "字体风格" : "Typography"}</Text>
+ <Text style={imageShareStyles.previewTitle}>{getMobileCatalog(resolvedLocale).editor.imageShare.fontStyle}</Text>
</View>
<MobileNoteImageFontPicker
selected={imageShareFontStyle}
theme={imageShareTheme}
chinese={resolvedLocale === "zh-CN"}
+ copy={{
+ fontStyles: getMobileCatalog(resolvedLocale).editor.imageShare.fontStyles,
+ templateFonts: getMobileCatalog(resolvedLocale).editor.imageShare.templateFonts,
+ title: getMobileCatalog(resolvedLocale).editor.imageShare.fontStyle,
+ loadingPreview: getMobileCatalog(resolvedLocale).mobile.imageShare.loadingPreview,
+ previewUnavailable: getMobileCatalog(resolvedLocale).mobile.imageShare.previewUnavailable,
+ }}
onSelect={async (font) => {
setImageSharePreference("fontStyle", font);
setImageShareFontPickerOpen(false);
@@ -1721,15 +1703,15 @@ export const MemoDetailModal = ({
</View>
) : null}
<View style={[imageShareStyles.settingsContent, imageShareFontPickerOpen && imageShareStyles.hidden]}>
- <Text style={styles.actionSheetTitle}>{resolvedLocale !== "zh-CN" ? "Share as image" : "分享为图片"}</Text>
+ <Text style={styles.actionSheetTitle}>{getMobileCatalog(resolvedLocale).editor.imageShare.title}</Text>
<ScrollView contentContainerStyle={imageShareStyles.optionsContent} showsVerticalScrollIndicator={false} style={imageShareStyles.optionsScroll}>
{imageSharePreferencesReady ? <>
- <Text style={styles.actionSheetSectionTitle}>{resolvedLocale !== "zh-CN" ? "Theme" : "主题风格"}</Text>
+ <Text style={styles.actionSheetSectionTitle}>{getMobileCatalog(resolvedLocale).editor.imageShare.theme}</Text>
<View style={imageShareStyles.themeGrid}>
{MOBILE_THEME_OPTIONS.map((item) => {
const isSelected = imageShareTheme === item.id;
- const label = resolvedLocale !== "zh-CN" ? item.labelEn : item.labelZh;
+ const label = getMobileCatalog(resolvedLocale).editor.imageShare.themes[item.id];
return (
<Pressable
key={item.id}
@@ -1755,12 +1737,12 @@ export const MemoDetailModal = ({
})}
</View>
- <Text style={styles.actionSheetSectionTitle}>{resolvedLocale !== "zh-CN" ? "Font size" : "字号大小"}</Text>
+ <Text style={styles.actionSheetSectionTitle}>{getMobileCatalog(resolvedLocale).mobile.imageShare.fontSize}</Text>
<View style={imageShareStyles.choiceRow}>
{([
- ["sm", resolvedLocale !== "zh-CN" ? "Compact" : "紧凑"],
- ["md", resolvedLocale !== "zh-CN" ? "Standard" : "标准"],
- ["lg", resolvedLocale !== "zh-CN" ? "Comfortable" : "舒适"],
+ ["sm", getMobileCatalog(resolvedLocale).editor.imageShare.fontSizes.sm],
+ ["md", getMobileCatalog(resolvedLocale).editor.imageShare.fontSizes.md],
+ ["lg", getMobileCatalog(resolvedLocale).editor.imageShare.fontSizes.lg],
] as const).map(([value, label]) => (
<Pressable key={value} accessibilityRole="button" onPress={() => setImageSharePreference("fontSize", value)} style={[imageShareStyles.choice, imageShareFontSize === value && imageShareStyles.choiceActive]}>
<Text style={[imageShareStyles.choiceText, imageShareFontSize === value && imageShareStyles.choiceTextActive]}>{label}</Text>
@@ -1768,12 +1750,12 @@ export const MemoDetailModal = ({
))}
</View>
- <Text style={styles.actionSheetSectionTitle}>{resolvedLocale !== "zh-CN" ? "Card width" : "卡片宽度"}</Text>
+ <Text style={styles.actionSheetSectionTitle}>{getMobileCatalog(resolvedLocale).mobile.imageShare.cardWidth}</Text>
<View style={imageShareStyles.choiceRow}>
{([
- ["compact", resolvedLocale !== "zh-CN" ? "Compact" : "紧凑"],
- ["standard", resolvedLocale !== "zh-CN" ? "Standard" : "标准"],
- ["wide", resolvedLocale !== "zh-CN" ? "Wide" : "宽屏"],
+ ["compact", getMobileCatalog(resolvedLocale).editor.imageShare.fontSizes.sm],
+ ["standard", getMobileCatalog(resolvedLocale).editor.imageShare.fontSizes.md],
+ ["wide", getMobileCatalog(resolvedLocale).mobile.imageShare.wide],
] as const).map(([value, label]) => (
<Pressable key={value} accessibilityRole="button" onPress={() => setImageSharePreference("cardWidth", value)} style={[imageShareStyles.choice, imageShareCardWidth === value && imageShareStyles.choiceActive]}>
<Text style={[imageShareStyles.choiceText, imageShareCardWidth === value && imageShareStyles.choiceTextActive]}>{label}</Text>
@@ -1783,29 +1765,27 @@ export const MemoDetailModal = ({
<Pressable
accessibilityRole="button"
- accessibilityLabel={`${resolvedLocale === "zh-CN" ? "字体风格" : "Typography"}: ${imageShareFontLabel}`}
- accessibilityHint={resolvedLocale === "zh-CN" ? "打开字体选择列表" : "Open font selection"}
+ accessibilityLabel={`${getMobileCatalog(resolvedLocale).editor.imageShare.fontStyle}: ${imageShareFontLabel}`}
+ accessibilityHint={getMobileCatalog(resolvedLocale).mobile.imageShare.openFontPicker}
onPress={() => setImageShareFontPickerOpen(true)}
style={imageShareStyles.fontSelector}
>
- <Text style={imageShareStyles.optionLabel}>{resolvedLocale === "zh-CN" ? "字体风格" : "Typography"}</Text>
+ <Text style={imageShareStyles.optionLabel}>{getMobileCatalog(resolvedLocale).editor.imageShare.fontStyle}</Text>
<Text style={imageShareStyles.fontSelectorValue}>
{imageShareFontLabel}
</Text>
<ChevronDown color="#64748b" size={18} />
</Pressable>
- <Text style={imageShareStyles.choiceText}>{resolvedLocale === "zh-CN"
- ? "下载型字体首次使用需联网,下载后缓存;普惠体等推荐字体保留完整文件,首次下载较大。"
- : "Downloadable fonts need a connection on first use and are cached. PuHuiTi and other recommended fonts use complete original files, so initial downloads are larger."}</Text>
+ <Text style={imageShareStyles.choiceText}>{getMobileCatalog(resolvedLocale).mobile.imageShare.fontDownloadNotice}</Text>
- <Text style={styles.actionSheetSectionTitle}>{resolvedLocale !== "zh-CN" ? "Content Elements" : "显示内容"}</Text>
+ <Text style={styles.actionSheetSectionTitle}>{getMobileCatalog(resolvedLocale).editor.imageShare.metadata}</Text>
{([
- [resolvedLocale !== "zh-CN" ? "Title" : "笔记标题", imageShareTitle, "showTitle"],
- [resolvedLocale !== "zh-CN" ? "Notebook" : "笔记本", imageShareNotebook, "showNotebook"],
- [resolvedLocale !== "zh-CN" ? "Tags" : "标签", imageShareTags, "showTags"],
- [resolvedLocale !== "zh-CN" ? "Updated time" : "更新时间", imageShareUpdatedAt, "showUpdatedAt"],
- [resolvedLocale !== "zh-CN" ? "EdgeEver branding" : "EdgeEver 品牌标识", imageShareBranding, "showBranding"],
+ [getMobileCatalog(resolvedLocale).editor.imageShare.fields.title, imageShareTitle, "showTitle"],
+ [getMobileCatalog(resolvedLocale).editor.imageShare.fields.notebook, imageShareNotebook, "showNotebook"],
+ [getMobileCatalog(resolvedLocale).mobile.imageShare.tags, imageShareTags, "showTags"],
+ [getMobileCatalog(resolvedLocale).editor.imageShare.fields.updatedAt, imageShareUpdatedAt, "showUpdatedAt"],
+ [getMobileCatalog(resolvedLocale).editor.imageShare.fields.branding, imageShareBranding, "showBranding"],
] as const).map(([label, selected, preferenceKey]) => (
<Pressable key={label} accessibilityRole="checkbox" accessibilityState={{ checked: selected }} onPress={() => setImageSharePreference(preferenceKey, !selected)} style={imageShareStyles.optionRow}>
<Text style={imageShareStyles.optionLabel}>{label}</Text>
@@ -1813,14 +1793,14 @@ export const MemoDetailModal = ({
</Pressable>
))}
- <Text style={styles.actionSheetSectionTitle}>{resolvedLocale !== "zh-CN" ? "Format" : "格式"}</Text>
+ <Text style={styles.actionSheetSectionTitle}>{getMobileCatalog(resolvedLocale).mobile.imageShare.format}</Text>
<View style={imageShareStyles.choiceRow}>
{(["png", "jpeg"] as const).map((value) => (
<Pressable key={value} accessibilityRole="button" onPress={() => setImageSharePreference("format", value)} style={[imageShareStyles.formatChoice, imageShareFormat === value && imageShareStyles.choiceActive]}>
<Text style={[imageShareStyles.choiceText, imageShareFormat === value && imageShareStyles.choiceTextActive]}>
{value === "png"
- ? (resolvedLocale !== "zh-CN" ? "PNG · Crisp text" : "PNG · 超清无损")
- : (resolvedLocale !== "zh-CN" ? "JPEG · Smaller file" : "JPEG · 体积小")}
+ ? getMobileCatalog(resolvedLocale).mobile.imageShare.pngOption
+ : getMobileCatalog(resolvedLocale).mobile.imageShare.jpegOption}
</Text>
</Pressable>
))}
@@ -1850,14 +1830,14 @@ export const MemoDetailModal = ({
{isExportingImage ? <ActivityIndicator color="#ffffff" size="small" /> : <Share2 color="#ffffff" size={18} />}
<Text style={imageShareStyles.shareButtonText}>
{isExportingImage
- ? (imageFontStatus === "loading" ? (resolvedLocale === "zh-CN" ? "字体加载中…" : "Loading font…") : imageExportStage === "render"
- ? (resolvedLocale !== "zh-CN" ? "Rendering image…" : "正在渲染图片…")
+ ? (imageFontStatus === "loading" ? getMobileCatalog(resolvedLocale).mobile.imageShare.loadingFont : imageExportStage === "render"
+ ? getMobileCatalog(resolvedLocale).mobile.imageShare.rendering
: imageExportStage === "transfer"
- ? (resolvedLocale !== "zh-CN" ? "Saving preview…" : "正在保存预览…")
- : (resolvedLocale !== "zh-CN" ? "Preparing image…" : "正在准备图片…"))
+ ? getMobileCatalog(resolvedLocale).mobile.imageShare.savingPreview
+ : getMobileCatalog(resolvedLocale).mobile.imageShare.preparingImage)
: !viewerReady
- ? (resolvedLocale !== "zh-CN" ? "Preparing note…" : "正在准备笔记…")
- : (resolvedLocale !== "zh-CN" ? "Generate preview" : "生成预览")}
+ ? getMobileCatalog(resolvedLocale).mobile.imageShare.preparingNote
+ : getMobileCatalog(resolvedLocale).mobile.imageShare.generatePreview}
</Text>
</Pressable>
</View>
@@ -1879,8 +1859,8 @@ export const MemoDetailModal = ({
{imagePreview ? (
<ZoomableImagePreview
key={imagePreview.source}
- accessibilityHint={resolvedLocale !== "zh-CN" ? "Long press for image actions" : "长按打开图片操作"}
- accessibilityLabel={imagePreview.alt || (resolvedLocale !== "zh-CN" ? "Image preview" : "图片预览")}
+ accessibilityHint={getMobileCatalog(resolvedLocale).mobile.memoDetail.imageActionsHint}
+ accessibilityLabel={imagePreview.alt || getMobileCatalog(resolvedLocale).mobile.imageShare.preview}
onLongPress={() => {
// Long-press fullscreen preview → same resource sheet as ⋯ in the note.
const target = getMobileImageTarget(imagePreview.source, imagePreview.alt);
@@ -1904,7 +1884,7 @@ export const MemoDetailModal = ({
/>
) : null}
<Pressable
- accessibilityLabel={resolvedLocale !== "zh-CN" ? "Close image preview" : "关闭图片预览"}
+ accessibilityLabel={getMobileCatalog(resolvedLocale).mobile.memoDetail.closeImagePreview}
accessibilityRole="button"
onPress={() => setImagePreview(null)}
style={resourceImageStyles.previewClose}
diff --git a/apps/mobile/src/screens/WorkspaceNotesView.tsx b/apps/mobile/src/screens/WorkspaceNotesView.tsx
index 23b2ceb6..4f07bad3 100644
--- a/apps/mobile/src/screens/WorkspaceNotesView.tsx
+++ b/apps/mobile/src/screens/WorkspaceNotesView.tsx
@@ -7,7 +7,7 @@ import { Gesture, GestureDetector, MouseButton, PointerType } from "react-native
import { ActivityIndicator, Check, ChevronDown, ChevronLeft, LayoutTemplate, MoreHorizontal, Plus, RotateCcw, Search, Sparkles, Tag, X } from "../components/icons";
import { Pressable, Text, TextInput } from "../components/LocalizedText";
import type { MobileBootstrapProgress } from "../lib/local-mirror";
-import { useMobileLocale } from "../lib/mobile-locale";
+import { useMobileLocale, getMobileCatalog } from "../lib/mobile-locale";
import { useMobileTheme } from "../lib/mobile-theme";
import type { MobileMemoListDensity } from "../lib/preferences";
import { formatMemoPreviewDate } from "./workspace-utils";
@@ -445,8 +445,8 @@ const MemoCard = memo(function MemoCard({
const listTimestamp = getMemoListTimestamp(memo, sortMode);
const listTimestampLabel = formatMemoPreviewDate(listTimestamp.value, localePreference);
const listTimestampKind = listTimestamp.field === "createdAt"
- ? (resolvedLocale !== "zh-CN" ? "Created" : "创建")
- : (resolvedLocale !== "zh-CN" ? "Updated" : "更新");
+ ? getMobileCatalog(resolvedLocale).mobile.notes.created
+ : getMobileCatalog(resolvedLocale).mobile.notes.updated;
const handledLongPressRef = useRef(false);
const rightClickGesture = Gesture.Tap()
.mouseButton(MouseButton.RIGHT)
@@ -477,7 +477,7 @@ const MemoCard = memo(function MemoCard({
</Pressable>
) : null}
<Pressable
- accessibilityHint={selectionMode ? undefined : (resolvedLocale !== "zh-CN" ? "Long press to select this note" : "长按选择这条笔记")}
+ accessibilityHint={selectionMode ? undefined : getMobileCatalog(resolvedLocale).mobile.notes.selectHint}
accessibilityLabel={memoTitle}
accessibilityRole="button"
delayLongPress={520}
diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx
index fbb3c73e..a4bc3a9b 100644
--- a/apps/mobile/src/screens/WorkspaceScreen.tsx
+++ b/apps/mobile/src/screens/WorkspaceScreen.tsx
@@ -31,7 +31,7 @@ import {
writeMobileMemoListDensity,
type MobileMemoListDensity,
} from "../lib/preferences";
-import { localizeUntitledMemoTitle, localizeMissingNotebookName, toMobileSyncErrorSourceText, useMobileLocale } from "../lib/mobile-locale";
+import { localizeUntitledMemoTitle, localizeMissingNotebookName, toMobileSyncErrorSourceText, useMobileLocale, getMobileCatalog } from "../lib/mobile-locale";
import { useSession } from "../lib/session";
import {
clearMobileMemoUpdateQueueItem,
@@ -484,10 +484,8 @@ export const WorkspaceScreen = ({
const openRichEditor = useCallback((memo: MemoDetail, initialFocus: "body" | "title" = "body") => {
if (hasDiagramDocumentMarker(memo.contentMarkdown)) {
Alert.alert(
- resolvedLocale !== "zh-CN" ? "View-only diagram" : "图表暂为只读",
- resolvedLocale !== "zh-CN"
- ? "Visual diagram editing is currently available on Web and desktop."
- : "可视化图表目前请在 Web 或桌面端编辑。"
+ getMobileCatalog(resolvedLocale).mobile.workspace.diagramReadOnly,
+ getMobileCatalog(resolvedLocale).mobile.workspace.diagramReadOnlyHint
);
return;
}
@@ -1117,7 +1115,7 @@ export const WorkspaceScreen = ({
memo.contentJson,
target,
resource.filename || filename,
- resolvedLocale !== "zh-CN" ? "Attachment: " : "附件:"
+ getMobileCatalog(resolvedLocale).mobile.common.attachmentPrefix
);
await localUpdateMemoMutation.mutateAsync({
memo,
diff --git a/apps/mobile/src/screens/WorkspaceSettingsView.tsx b/apps/mobile/src/screens/WorkspaceSettingsView.tsx
index de3c233e..2b84316c 100644
--- a/apps/mobile/src/screens/WorkspaceSettingsView.tsx
+++ b/apps/mobile/src/screens/WorkspaceSettingsView.tsx
@@ -7,7 +7,7 @@ import { useQuery } from "@tanstack/react-query";
import { BackHandler, Dimensions, Linking, Modal, PixelRatio, Platform, ScrollView, Switch, View } from "react-native";
import { Activity, ActivityIndicator, Check, ChevronDown, ChevronLeft, ChevronRight, Cloud, Copy, ExternalLink, Image as ImageIcon, Info, LogOut, MessageSquare, MonitorSmartphone, Moon, RefreshCw, ShieldCheck, SlidersHorizontal, Sun, UserRound } from "../components/icons";
import { Pressable, Text } from "../components/LocalizedText";
-import { useMobileLocale } from "../lib/mobile-locale";
+import { useMobileLocale, getMobileCatalog, type MobileLocale } from "../lib/mobile-locale";
import { useMobileTheme } from "../lib/mobile-theme";
import { useMobileUpdate } from "../lib/mobile-update";
import type { MobileLocalePreference } from "../lib/preferences";
@@ -34,15 +34,15 @@ const readMobileDeviceModel = () => {
};
const formatExecutionEnvironment = (environment: string | null | undefined, localePreference: MobileLocaleMode = "system") => {
- const english = isEnglishMobileLocale(localePreference);
+ const locale = getResolvedMobileLocale(localePreference);
switch (environment) {
case "standalone":
- return english ? "Standalone app" : "独立安装包";
+ return getMobileCatalog(locale).mobile.settings.standaloneApp;
case "storeClient":
- return english ? "Expo Go / development client" : "Expo Go / 开发客户端";
+ return getMobileCatalog(locale).mobile.settings.expoGo;
case "bare":
- return english ? "Native app" : "原生应用";
+ return getMobileCatalog(locale).mobile.settings.nativeApp;
default:
return environment || getMobileSystemInfoText(localePreference).unknown;
}
@@ -412,23 +412,23 @@ const SystemInfoCard = ({
const [expanded, setExpanded] = useState(defaultExpanded);
const { checkForUpdate, hasUpdate, openUpdate, status, updateKind } = useMobileUpdate();
const localePreference = useMobileLocalePreference();
- const english = isEnglishMobileLocale(localePreference);
+ const locale = getResolvedMobileLocale(localePreference);
const copy = getMobileSystemInfoText(localePreference);
const infoGroups = getMobileSystemInfoGroups(localePreference, { connectionState, instance, instanceUrl, sync });
const description = hasUpdate ? copy.updateAvailableDescription : copy.description;
const checking = status === "checking";
const downloading = status === "downloading";
const checkLabel = checking
- ? (english ? "Checking…" : "正在检查…")
- : (english ? "Check for updates" : "检查更新");
+ ? getMobileCatalog(locale).mobile.update.checking
+ : getMobileCatalog(locale).mobile.update.checkForUpdates;
const openUpdateLabel = downloading
- ? (english ? "Downloading…" : "正在下载…")
+ ? getMobileCatalog(locale).mobile.update.downloading
: status === "ready"
- ? (english ? "Restart to apply" : "重启以应用")
+ ? getMobileCatalog(locale).mobile.update.restartToApply
: updateKind === "ota"
- ? (english ? "Download update" : "下载更新")
+ ? getMobileCatalog(locale).mobile.update.downloadUpdate
: updateKind === "play"
- ? (english ? "Update with Google Play" : "通过 Google Play 更新")
+ ? getMobileCatalog(locale).mobile.update.updateWithGooglePlay
: copy.openUpdate;
const copySystemInfo = async () => {
@@ -454,7 +454,7 @@ const SystemInfoCard = ({
</Pressable>
{expanded ? (
<View style={styles.settingsAccordionContent}>
- <SettingsActionButton label={copied ? (english ? "Copied" : "已复制") : (english ? "Copy info" : "复制信息")} onPress={copySystemInfo}>
+ <SettingsActionButton label={copied ? getMobileCatalog(locale).common.copied : getMobileCatalog(locale).systemInfo.copy} onPress={copySystemInfo}>
{copied ? <ShieldCheck color="#047857" size={16} /> : <Copy color="#0f172a" size={16} />}
</SettingsActionButton>
{hasUpdate ? (
@@ -521,110 +521,50 @@ const MobileSystemInfoSection = ({ group }: { group: MobileSystemInfoGroup }) =>
};
-const getMobileSystemInfoText = (localePreference: MobileLocaleMode) =>
- isEnglishMobileLocale(localePreference)
- ? {
- build: "Build type",
- developmentBuild: "Development",
- productionBuild: "Production",
- client: "Client",
- clientAheadOfInstanceCloudflare: "This client is newer than the connected cloud instance. You can wait for the daily automatic instance update, or run the Update deployed EdgeEver workflow.",
- clientAheadOfInstanceDocker: "This client is newer than the connected cloud instance. You can wait for the daily automatic instance update, or run ./update.sh in the install directory (default ~/edgeever).",
- clientAheadOfInstanceUnknown: "This client is newer than the connected cloud instance. You can wait for the daily automatic instance update, or update the instance manually.",
- clientDescription: "The EdgeEver app and runtime environment on this device.",
- clientSection: "Current client",
- cloudDescription: "Version and deployment environment for the connected instance.",
- cloudSection: "Cloud instance",
- connected: "Connected",
- connectionChecking: "Checking",
- connectionDescription: "Connection and local sync queue status.",
- connectionFailed: "Connection failed",
- connectionSection: "Connection and sync",
- containerImageSource: "Container image source",
- imageBuiltAt: "Image built at",
- databaseBackend: "Database backend",
- databaseVersion: "Database version",
- description: "View cloud instance and current client diagnostics.",
- deploymentPlatform: "Deployment platform",
- existingAttachments: "Existing attachments",
- existingAttachmentsOriginalStorage: "Read from original storage",
- failedSync: "Failed or conflicted",
- followSystem: "Follow system",
- installMode: "Mode",
- instanceBuild: "Instance build",
- deploymentVersionTime: "Instance deployment time",
- instanceConnection: "Instance connection",
- instanceUrl: "Instance URL",
- instanceVersion: "Instance version",
- language: "Language",
- newUploadObjectStorage: "New upload object storage",
- pendingSync: "Pending sync",
- platform: "System",
- mobileApp: "Mobile app",
- platformVersion: "System version",
- requestLatency: "Health check time",
- deviceModel: "Device model",
- screenResolution: "Screen resolution",
- screenResolutionValue: "{{screen}} @{{dpr}}x",
- timeZone: "Time zone",
- openUpdate: "Get update",
- title: "System info",
- unknown: "Unknown",
- updateAvailableDescription: "A new version is available. Tap for details.",
- updateAvailableTitle: "Update available",
- version: "Version",
- }
- : {
- build: "构建类型",
- developmentBuild: "开发版",
- productionBuild: "正式版",
- client: "客户端",
- clientAheadOfInstanceCloudflare: "当前客户端版本高于云端实例。可等待每天自动更新,或手动运行 Update deployed EdgeEver 工作流。",
- clientAheadOfInstanceDocker: "当前客户端版本高于云端实例。可等待每天自动更新,或在安装目录执行 ./update.sh(默认 ~/edgeever)。",
- clientAheadOfInstanceUnknown: "当前客户端版本高于云端实例。可等待每天自动更新,也可手动更新实例。",
- clientDescription: "这台设备上的 EdgeEver 应用与运行环境。",
- clientSection: "当前客户端",
- cloudDescription: "当前连接实例的版本与部署环境。",
- cloudSection: "云端实例",
- connected: "连接正常",
- connectionChecking: "正在检查",
- connectionDescription: "实例连接与本地同步队列状态。",
- connectionFailed: "连接失败",
- connectionSection: "连接与同步",
- containerImageSource: "容器镜像来源",
- imageBuiltAt: "镜像构建时间",
- databaseBackend: "数据库后端",
- databaseVersion: "数据库版本",
- description: "查看云端实例与当前客户端的诊断信息。",
- deploymentPlatform: "部署平台",
- existingAttachments: "已有附件",
- existingAttachmentsOriginalStorage: "继续从原存储读取",
- failedSync: "失败或冲突",
- followSystem: "跟随系统",
- installMode: "安装形态",
- instanceBuild: "实例构建",
- deploymentVersionTime: "实例部署时间",
- instanceConnection: "实例连接",
- instanceUrl: "实例地址",
- instanceVersion: "实例版本",
- language: "语言",
- newUploadObjectStorage: "新上传对象存储",
- pendingSync: "待同步",
- platform: "系统",
- mobileApp: "移动应用",
- platformVersion: "系统版本",
- requestLatency: "健康检查耗时",
- deviceModel: "设备型号",
- screenResolution: "屏幕分辨率",
- screenResolutionValue: "{{screen}} @{{dpr}}x",
- timeZone: "时区",
- openUpdate: "前往更新",
- title: "系统信息",
- unknown: "未知",
- updateAvailableDescription: "发现新版本,点按查看详情。",
- updateAvailableTitle: "发现新版本",
- version: "版本",
- };
+const getMobileSystemInfoText = (localePreference: MobileLocaleMode) => {
+ const { mobile, systemInfo } = getMobileCatalog(getResolvedMobileLocale(localePreference));
+ return {
+ ...mobile.systemInfo,
+ client: systemInfo.client,
+ clientAheadOfInstanceCloudflare: systemInfo.clientAheadOfInstanceByPlatform.cloudflare,
+ clientAheadOfInstanceDocker: systemInfo.clientAheadOfInstanceByPlatform.docker,
+ clientAheadOfInstanceUnknown: systemInfo.clientAheadOfInstanceByPlatform.unknown,
+ clientDescription: systemInfo.clientSectionDescription,
+ clientSection: systemInfo.clientSection,
+ cloudDescription: systemInfo.cloudSectionDescription,
+ cloudSection: systemInfo.cloudSection,
+ connected: systemInfo.connectionConnected,
+ connectionChecking: systemInfo.connectionChecking,
+ connectionFailed: systemInfo.connectionFailed,
+ connectionSection: systemInfo.connectionSection,
+ containerImageSource: systemInfo.containerImageSource,
+ imageBuiltAt: systemInfo.imageBuiltAt,
+ databaseBackend: systemInfo.databaseBackend,
+ databaseVersion: systemInfo.databaseMigration,
+ deploymentPlatform: systemInfo.deploymentPlatform,
+ deploymentVersionTime: systemInfo.deploymentVersionTime,
+ deviceModel: systemInfo.deviceModel,
+ existingAttachments: systemInfo.existingAttachments,
+ failedSync: systemInfo.failedSync,
+ installMode: systemInfo.installMode,
+ instanceBuild: systemInfo.instanceBuild,
+ instanceConnection: systemInfo.instanceConnection,
+ instanceUrl: systemInfo.instanceUrl,
+ instanceVersion: systemInfo.instanceVersion,
+ language: systemInfo.language,
+ mobileApp: systemInfo.clients.mobileApp,
+ newUploadObjectStorage: systemInfo.newUploadObjectStorage,
+ pendingSync: systemInfo.pendingSync,
+ platform: systemInfo.os,
+ requestLatency: systemInfo.requestLatency,
+ screenResolution: systemInfo.screenResolution,
+ screenResolutionValue: systemInfo.screenResolutionValue,
+ timeZone: systemInfo.timeZone,
+ title: systemInfo.title,
+ unknown: systemInfo.unknown,
+ version: systemInfo.version,
+ };
+};
const getMobileClientAheadNotice = (
copy: ReturnType<typeof getMobileSystemInfoText>,
@@ -637,18 +577,18 @@ const getMobileClientAheadNotice = (
return copy.clientAheadOfInstanceUnknown;
};
-const getMobileDeploymentPlatform = (runtime: string | null | undefined, english: boolean) => {
+const getMobileDeploymentPlatform = (runtime: string | null | undefined, locale: MobileLocale) => {
if (runtime === "cloudflare-workers") return "Cloudflare";
if (runtime === "self-hosted-bun") return "Docker";
- return english ? "Unknown" : "未知";
+ return getMobileCatalog(locale).systemInfo.unknown;
};
-const getMobileContainerImageSource = (source: string | null | undefined, english: boolean) => {
+const getMobileContainerImageSource = (source: string | null | undefined, locale: MobileLocale) => {
switch (source) {
case "official-ghcr": return "GitHub Container Registry (GHCR)";
- case "official-cn-mirror": return english ? "Official mainland China mirror" : "中国大陆官方镜像";
- case "custom": return english ? "Custom image" : "自定义镜像";
- default: return english ? "Unknown" : "未知";
+ case "official-cn-mirror": return getMobileCatalog(locale).systemInfo.containerImageSources["official-cn-mirror"];
+ case "custom": return getMobileCatalog(locale).systemInfo.containerImageSources.custom;
+ default: return getMobileCatalog(locale).systemInfo.unknown;
}
};
@@ -658,13 +598,13 @@ const getMobileDatabaseBackend = (backend: string | null | undefined, unknown: s
return backend || unknown;
};
-const getMobileObjectStorage = (health: InstanceHealth | undefined, english: boolean, unknown: string) => {
- if (health?.objectStorageProvider === "s3") return english ? "Third-party S3-compatible OSS" : "第三方 S3 兼容 OSS";
+const getMobileObjectStorage = (health: InstanceHealth | undefined, locale: MobileLocale, unknown: string) => {
+ if (health?.objectStorageProvider === "s3") return getMobileCatalog(locale).systemInfo.objectStorageBackends.external_s3;
if (health?.objectStorageProvider !== "builtin") return unknown;
switch (health.storage?.resources) {
- case "r2": return english ? "Built-in R2" : "内置 R2";
- case "filesystem": return english ? "Local filesystem" : "本地文件系统";
- case "s3": return english ? "Instance-provided S3-compatible storage" : "实例内置 S3 兼容存储";
+ case "r2": return getMobileCatalog(locale).systemInfo.objectStorageBackends.builtin_r2;
+ case "filesystem": return getMobileCatalog(locale).systemInfo.objectStorageBackends.builtin_filesystem;
+ case "s3": return getMobileCatalog(locale).systemInfo.objectStorageBackends.builtin_s3;
default: return unknown;
}
};
@@ -725,7 +665,6 @@ const getMobileSystemInfoGroups = (
} = {},
): MobileSystemInfoGroup[] => {
const copy = getMobileSystemInfoText(localePreference);
- const english = isEnglishMobileLocale(localePreference);
const resolvedLocale = getResolvedMobileLocale(localePreference);
const platformName =
Platform.OS === "android"
@@ -753,7 +692,7 @@ const getMobileSystemInfoGroups = (
return [
{
- columns: english ? 2 : 3,
+ columns: resolvedLocale === "zh-CN" ? 3 : 2,
description: copy.cloudDescription,
id: "cloud",
notice: getMobileClientAheadNotice(copy, instance?.version, instance?.health.runtime),
@@ -764,25 +703,25 @@ const getMobileSystemInfoGroups = (
{ label: copy.instanceVersion, mono: true, value: instance?.version ? `v${instance.version.replace(/^v/, "")}` : copy.unknown },
{ label: copy.databaseVersion, mono: true, value: instance?.health.migration || copy.unknown },
{ label: copy.databaseBackend, value: getMobileDatabaseBackend(instance?.health.storage?.database, copy.unknown) },
- { label: copy.deploymentPlatform, value: getMobileDeploymentPlatform(instance?.health.runtime, english) },
+ { label: copy.deploymentPlatform, value: getMobileDeploymentPlatform(instance?.health.runtime, resolvedLocale) },
{ label: copy.instanceBuild, mono: true, value: instance?.health.build || copy.unknown, wide: true },
{
label: copy.deploymentVersionTime,
value: instance?.health.deploymentVersionCreatedAt && Number.isFinite(Date.parse(instance.health.deploymentVersionCreatedAt))
- ? new Intl.DateTimeFormat(english ? "en-US" : "zh-CN", { dateStyle: "medium", timeStyle: "short" }).format(new Date(instance.health.deploymentVersionCreatedAt))
+ ? new Intl.DateTimeFormat(resolvedLocale, { dateStyle: "medium", timeStyle: "short" }).format(new Date(instance.health.deploymentVersionCreatedAt))
: copy.unknown,
},
- { fullWidth: true, label: copy.newUploadObjectStorage, value: getMobileObjectStorage(instance?.health, english, copy.unknown) },
+ { fullWidth: true, label: copy.newUploadObjectStorage, value: getMobileObjectStorage(instance?.health, resolvedLocale, copy.unknown) },
...(instance?.health.objectStorageProvider === "s3"
? [{ fullWidth: true, label: copy.existingAttachments, value: copy.existingAttachmentsOriginalStorage }]
: []),
...(instance?.health.runtime === "self-hosted-bun"
? [
- { fullWidth: true, label: copy.containerImageSource, value: getMobileContainerImageSource(instance.health.containerImageSource, english) },
+ { fullWidth: true, label: copy.containerImageSource, value: getMobileContainerImageSource(instance.health.containerImageSource, resolvedLocale) },
{
label: copy.imageBuiltAt,
value: instance.health.buildCreatedAt && Number.isFinite(Date.parse(instance.health.buildCreatedAt))
- ? new Intl.DateTimeFormat(english ? "en-US" : "zh-CN", { dateStyle: "medium", timeStyle: "short" }).format(new Date(instance.health.buildCreatedAt))
+ ? new Intl.DateTimeFormat(resolvedLocale, { dateStyle: "medium", timeStyle: "short" }).format(new Date(instance.health.buildCreatedAt))
: copy.unknown,
},
]
@@ -791,7 +730,7 @@ const getMobileSystemInfoGroups = (
title: copy.cloudSection,
},
{
- columns: english ? 2 : 3,
+ columns: resolvedLocale === "zh-CN" ? 3 : 2,
description: copy.clientDescription,
id: "client",
items: [
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 669582a8..61b96385 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -3414,4 +3414,187 @@ export const enUS = {
resetting: "Resetting...",
privacyNotice: "Demo environment. Please do not save private notes.",
},
+ // Native mobile client copy.
+ mobile: {
+ ai: {
+ append: "Append",
+ chooseAction: "Choose an action",
+ chooseTargetLanguage: "Choose target language",
+ chooseTone: "Choose tone",
+ copy: "Copy",
+ draft: "AI draft",
+ draftPlaceholder: "The generated draft will appear here.",
+ generating: "Generating…",
+ generationFailed: "AI generation failed.",
+ instructionPlaceholder: "For example: Restructure this for a weekly report and keep all data",
+ intro: "Choose what AI should do. Output remains a draft until you apply it.",
+ invalidRequest: "The AI request is invalid.",
+ modelNotConfigured: "Configure a model in Models and agents on the web or desktop app first.",
+ noteUpdateFailed: "Could not update the note.",
+ noteUpdated: "Note updated",
+ refinePlaceholder: "For example: Make it more concise",
+ refineResult: "Refine result",
+ regenerate: "Regenerate",
+ replace: "Replace",
+ signedOut: "AI is unavailable while signed out.",
+ },
+ common: {
+ attachmentPrefix: "Attachment: ",
+ downloaded: "Downloaded",
+ imageLoadFailed: "Image failed to load",
+ networkError: "network error",
+ noteImageLoadFailed: "Could not load a note image ({{status}}). Check the network and try again.",
+ resourceUnavailable: "The resource client is unavailable.",
+ savedFile: "Saved {{filename}}",
+ sharingUnavailable: "Sharing is unavailable on this device.",
+ tryAgainLater: "Try again later.",
+ },
+ imageShare: {
+ advancedJpeg: "Advanced export JPEG",
+ advancedPng: "Advanced export PNG",
+ backToSettings: "Back to share settings",
+ cardWidth: "Card width",
+ closePreview: "Close preview",
+ exportFailed: "Image export failed",
+ folderNotWritable: "This folder cannot accept files. Choose a folder in internal storage, such as Pictures.",
+ fontDownloadNotice: "Downloadable fonts need a connection on first use and are cached. PuHuiTi and other recommended fonts use complete original files, so initial downloads are larger.",
+ fontSize: "Font size",
+ format: "Format",
+ generatePreview: "Generate preview",
+ generating: "Generating share image",
+ imagesOmitted: "{{failed}} of {{total}} note image(s) could not be included.",
+ jpegOption: "JPEG · Smaller file",
+ loadingFont: "Loading font…",
+ loadingPreview: "Loading preview…",
+ longImageWarning: "This is a long image. Some social apps may reduce its quality; keep the saved original.",
+ openFontPicker: "Open font selection",
+ pngOption: "PNG · Crisp text",
+ preparingImage: "Preparing image…",
+ preparingNote: "Preparing note…",
+ preview: "Image preview",
+ previewUnavailable: "Preview unavailable; you can still select this font",
+ renderFailed: "This image could not be rendered on this device. Try a smaller font size or a shorter note.",
+ rendering: "Rendering image…",
+ save: "Save",
+ saveFailed: "Save failed",
+ savedTo: "Saved to",
+ savingPreview: "Saving preview…",
+ selectedFolder: "Selected folder / {{filename}}",
+ share: "Share",
+ tags: "Tags",
+ timedOut: "Image generation timed out. Please try again.",
+ tooLong: "This note is too long for one readable image. Choose a smaller font size or split the note.",
+ viewerNotReady: "The note viewer is not ready. Try again.",
+ wide: "Wide",
+ },
+ login: {
+ apiNotFound: "No EdgeEver API was found at this instance address.",
+ authNotConfigured: "Sign-in is not configured for this instance.",
+ cloudflareChallenge: "A Cloudflare browser challenge intercepted the login API. Ask the instance administrator to adjust the WAF Challenge rule for the API.",
+ databaseNotReady: "The instance database is not ready.",
+ failed: "Sign-in failed. Try again later.",
+ invalidCredentials: "The username or password is incorrect.",
+ invalidPasswordConfig: "The instance password configuration is invalid.",
+ invalidResponse: "The server response is not a valid EdgeEver response.",
+ loginRejected: "The instance rejected the login request.",
+ rateLimited: "Too many sign-in attempts. Try again later.",
+ requestRejected: "The instance rejected the request (HTTP {{status}}).",
+ securityPolicyBlocked: "A security policy blocked the request before it reached EdgeEver. Check Cloudflare Security Events, Access, WAF, or reverse-proxy rules.",
+ serverError: "The instance returned a server error (HTTP {{status}}).",
+ unreachable: "Unable to reach the instance. Check its address and your network connection.",
+ },
+ memoDetail: {
+ closeImagePreview: "Close image preview",
+ imageActionsHint: "Long press for image actions",
+ notSignedIn: "Not signed in.",
+ noteActions: "Note actions",
+ noteIdCopied: "Note ID copied",
+ noteIdCopyFailed: "Could not copy note ID",
+ openResourceFailed: "Unable to open resource",
+ shareFailed: "Share failed",
+ shareNote: "Share note",
+ },
+ mermaid: {
+ empty: "This Mermaid diagram is empty.",
+ label: "Mermaid diagram",
+ renderFailed: "Unable to render this Mermaid diagram. Check its syntax.",
+ rendering: "Rendering diagram…",
+ },
+ notes: {
+ created: "Created",
+ selectHint: "Long press to select this note",
+ updated: "Updated",
+ },
+ resources: {
+ attachmentActions: "Attachment actions",
+ attachmentUnavailable: "The attachment client is unavailable.",
+ shareAttachmentHint: "Opens the system share sheet for this attachment",
+ waitForSync: "Wait for this note to sync first.",
+ },
+ settings: {
+ expoGo: "Expo Go / development client",
+ nativeApp: "Native app",
+ standaloneApp: "Standalone app",
+ },
+ systemInfo: {
+ build: "Build type",
+ connectionDescription: "Connection and local sync queue status.",
+ description: "View cloud instance and current client diagnostics.",
+ developmentBuild: "Development",
+ existingAttachmentsOriginalStorage: "Read from original storage",
+ followSystem: "Follow system",
+ openUpdate: "Get update",
+ platformVersion: "System version",
+ productionBuild: "Production",
+ updateAvailableDescription: "A new version is available. Tap for details.",
+ updateAvailableTitle: "Update available",
+ },
+ update: {
+ available: "Update available",
+ checkForUpdates: "Check for updates",
+ checking: "Checking…",
+ chooseSource: "Choose update source",
+ chooseSourceHint: "Choose where to check for an app update.",
+ currentVersion: "Current version",
+ description: "EdgeEver automatically checks for compatible in-app updates and newer app versions.",
+ downloadUpdate: "Download update",
+ downloading: "Downloading…",
+ downloadingUpdate: "Downloading update…",
+ failed: "Update failed",
+ failedHint: "Could not download the in-app update. Try again later.",
+ installFailed: "Could not install update",
+ installFailedHint: "Try again, or use an existing update channel.",
+ later: "Later",
+ linkOpenFailed: "Could not open link",
+ linkOpenFailedHint: "Check your browser settings and try again.",
+ none: "No update",
+ noneHint: "No downloadable in-app update was found.",
+ openWebListing: "Open web listing",
+ playDisabled: "Google Play is disabled",
+ playDisabledHint: "Google Play Store is disabled. Enable it in system settings, or open the web listing instead.",
+ playNotInstalled: "Google Play is not installed",
+ playNotInstalledHint: "Google Play Store is not installed on this device, so this update channel is unavailable.",
+ playReadyHint: "Restart now to install the Google Play update, or continue using the app.",
+ playUnavailable: "Could not open Google Play",
+ playUnavailableHint: "Google Play Store could not handle this update link. Try again later, or open the web listing instead.",
+ ready: "Update ready",
+ readyHint: "Restart now to apply the update.",
+ releaseAvailable: "EdgeEver {{version}} is available. Choose where to update.",
+ releaseBuildsOnly: "Available in installed release builds.",
+ restart: "Restart",
+ restartToApply: "Restart to apply",
+ sources: {
+ github: "Download from GitHub",
+ "google-play": "Update on Google Play",
+ },
+ title: "App updates",
+ unsupported: "Updates unavailable",
+ unsupportedHint: "Update checks are available in installed release builds, not Expo Go or development builds.",
+ updateWithGooglePlay: "Update with Google Play",
+ },
+ workspace: {
+ diagramReadOnly: "View-only diagram",
+ diagramReadOnlyHint: "Visual diagram editing is currently available on Web and desktop.",
+ },
+ },
} as const;
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index fabd32dd..18dcb233 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -3403,4 +3403,187 @@ export const ja = {
resetting: "リセット中...",
privacyNotice: "デモ環境です。非公開のノートは保存しないでください。",
},
+ // Native mobile client copy.
+ mobile: {
+ ai: {
+ append: "追記",
+ chooseAction: "操作を選択",
+ chooseTargetLanguage: "翻訳先の言語を選択",
+ chooseTone: "トーンを選択",
+ copy: "コピー",
+ draft: "AI の下書き",
+ draftPlaceholder: "生成された下書きがここに表示されます。",
+ generating: "生成中…",
+ generationFailed: "AI の生成に失敗しました。",
+ instructionPlaceholder: "例:週報向けの構成に直し、すべてのデータを残す",
+ intro: "AI に行わせる操作を選んでください。出力は下書きとして扱われ、適用するまでノートは変更されません。",
+ invalidRequest: "AI リクエストが無効です。",
+ modelNotConfigured: "先に Web 版またはデスクトップ版の「モデルとエージェント」でモデルを設定してください。",
+ noteUpdateFailed: "ノートを更新できませんでした。",
+ noteUpdated: "ノートを更新しました",
+ refinePlaceholder: "例:もっと簡潔に",
+ refineResult: "結果を調整",
+ regenerate: "再生成",
+ replace: "置き換え",
+ signedOut: "サインインしていないため AI を使用できません。",
+ },
+ common: {
+ attachmentPrefix: "添付: ",
+ downloaded: "ダウンロードしました",
+ imageLoadFailed: "画像を読み込めませんでした",
+ networkError: "ネットワークエラー",
+ noteImageLoadFailed: "ノート内の画像を読み込めませんでした({{status}})。ネットワークを確認して再試行してください。",
+ resourceUnavailable: "現在リソースを読み込めません。",
+ savedFile: "保存しました: {{filename}}",
+ sharingUnavailable: "この端末では共有を利用できません。",
+ tryAgainLater: "しばらくしてから再試行してください。",
+ },
+ imageShare: {
+ advancedJpeg: "詳細書き出し JPEG",
+ advancedPng: "詳細書き出し PNG",
+ backToSettings: "共有設定に戻る",
+ cardWidth: "カードの幅",
+ closePreview: "プレビューを閉じる",
+ exportFailed: "画像を書き出せませんでした",
+ folderNotWritable: "このフォルダには保存できません。内部ストレージの別のフォルダ(例:「Pictures」)を選んでください。",
+ fontDownloadNotice: "ダウンロード型フォントは初回のみ通信が必要で、その後はキャッシュされます。PuHuiTi などのおすすめフォントは元のファイルをそのまま使うため、初回のダウンロードが大きくなります。",
+ fontSize: "文字サイズ",
+ format: "形式",
+ generatePreview: "プレビューを生成",
+ generating: "共有画像を生成中",
+ imagesOmitted: "ノート内の画像 {{total}} 枚のうち {{failed}} 枚を含められませんでした。",
+ jpegOption: "JPEG · 軽量",
+ loadingFont: "フォントを読み込み中…",
+ loadingPreview: "プレビューを読み込み中…",
+ longImageWarning: "縦に長い画像です。一部の SNS では画質が落ちる場合があるため、保存した元画像を残しておいてください。",
+ openFontPicker: "フォントの一覧を開く",
+ pngOption: "PNG · 高画質",
+ preparingImage: "画像を準備中…",
+ preparingNote: "ノートを準備中…",
+ preview: "画像のプレビュー",
+ previewUnavailable: "プレビューを表示できませんが、このフォントは選択できます",
+ renderFailed: "この端末では画像をレンダリングできませんでした。フォントサイズを小さくするか、短いノートで試してください。",
+ rendering: "画像をレンダリング中…",
+ save: "画像を保存",
+ saveFailed: "保存できませんでした",
+ savedTo: "保存先",
+ savingPreview: "プレビューを保存中…",
+ selectedFolder: "選択したフォルダ / {{filename}}",
+ share: "共有",
+ tags: "タグ",
+ timedOut: "画像の生成がタイムアウトしました。もう一度お試しください。",
+ tooLong: "このノートは長すぎて、読みやすい 1 枚の画像にできません。フォントサイズを小さくするか、ノートを分割してください。",
+ viewerNotReady: "ノートの準備ができていません。再試行してください。",
+ wide: "ワイド",
+ },
+ login: {
+ apiNotFound: "このインスタンスのアドレスに EdgeEver API が見つかりません。",
+ authNotConfigured: "このインスタンスではサインインが設定されていません。",
+ cloudflareChallenge: "Cloudflare のブラウザチャレンジがログイン API をブロックしました。インスタンス管理者に API 向けの WAF Challenge ルールの調整を依頼してください。",
+ databaseNotReady: "インスタンスのデータベースの準備ができていません。",
+ failed: "サインインに失敗しました。しばらくしてから再試行してください。",
+ invalidCredentials: "ユーザー名またはパスワードが正しくありません。",
+ invalidPasswordConfig: "インスタンスのパスワード設定が無効です。",
+ invalidResponse: "サーバーの応答が有効な EdgeEver の応答ではありません。",
+ loginRejected: "インスタンスがログイン要求を拒否しました。",
+ rateLimited: "サインインの試行回数が多すぎます。しばらくしてから再試行してください。",
+ requestRejected: "インスタンスがリクエストを拒否しました(HTTP {{status}})。",
+ securityPolicyBlocked: "リクエストが EdgeEver に届く前にセキュリティポリシーでブロックされました。Cloudflare Security Events、Access、WAF、またはリバースプロキシのルールを確認してください。",
+ serverError: "インスタンスでサーバーエラーが発生しました(HTTP {{status}})。",
+ unreachable: "インスタンスに接続できません。アドレスとネットワーク接続を確認してください。",
+ },
+ memoDetail: {
+ closeImagePreview: "画像のプレビューを閉じる",
+ imageActionsHint: "長押しで画像の操作を開きます",
+ notSignedIn: "サインインしていません。",
+ noteActions: "ノートの操作",
+ noteIdCopied: "ノート ID をコピーしました",
+ noteIdCopyFailed: "ノート ID をコピーできませんでした",
+ openResourceFailed: "リソースを開けません",
+ shareFailed: "共有できませんでした",
+ shareNote: "ノートを共有",
+ },
+ mermaid: {
+ empty: "この Mermaid 図には内容がありません。",
+ label: "Mermaid 図",
+ renderFailed: "この Mermaid 図をレンダリングできません。構文を確認してください。",
+ rendering: "図をレンダリング中…",
+ },
+ notes: {
+ created: "作成",
+ selectHint: "長押しでこのノートを選択します",
+ updated: "更新",
+ },
+ resources: {
+ attachmentActions: "添付の操作",
+ attachmentUnavailable: "現在添付を読み込めません。",
+ shareAttachmentHint: "この添付をシステムの共有シートで共有します",
+ waitForSync: "ノートの同期が完了するまでお待ちください。",
+ },
+ settings: {
+ expoGo: "Expo Go / 開発クライアント",
+ nativeApp: "ネイティブアプリ",
+ standaloneApp: "スタンドアロンアプリ",
+ },
+ systemInfo: {
+ build: "ビルドの種類",
+ connectionDescription: "インスタンスへの接続とローカル同期キューの状態です。",
+ description: "クラウドインスタンスと現在のクライアントの診断情報を表示します。",
+ developmentBuild: "開発版",
+ existingAttachmentsOriginalStorage: "元のストレージから読み込み",
+ followSystem: "システムに従う",
+ openUpdate: "アップデートを入手",
+ platformVersion: "システムのバージョン",
+ productionBuild: "リリース版",
+ updateAvailableDescription: "新しいバージョンがあります。タップして詳細を表示します。",
+ updateAvailableTitle: "アップデートがあります",
+ },
+ update: {
+ available: "アップデートがあります",
+ checkForUpdates: "アップデートを確認",
+ checking: "確認中…",
+ chooseSource: "アップデート方法を選択",
+ chooseSourceHint: "アプリのアップデートを確認する方法を選んでください。",
+ currentVersion: "現在のバージョン",
+ description: "EdgeEver は互換性のあるアプリ内アップデートと新しいバージョンを自動で確認します。",
+ downloadUpdate: "アップデートをダウンロード",
+ downloading: "ダウンロード中…",
+ downloadingUpdate: "アップデートをダウンロード中…",
+ failed: "アップデートに失敗しました",
+ failedHint: "アプリ内アップデートをダウンロードできませんでした。しばらくしてから再試行してください。",
+ installFailed: "アップデートをインストールできませんでした",
+ installFailedHint: "もう一度試すか、別のアップデート方法を使ってください。",
+ later: "後で",
+ linkOpenFailed: "リンクを開けませんでした",
+ linkOpenFailedHint: "ブラウザの設定を確認して再試行してください。",
+ none: "アップデートはありません",
+ noneHint: "ダウンロードできるアプリ内アップデートは見つかりませんでした。",
+ openWebListing: "Web 版のページを開く",
+ playDisabled: "Google Play が無効です",
+ playDisabledHint: "Google Play ストアが無効になっています。システム設定で有効にするか、Web 版のページを開いてください。",
+ playNotInstalled: "Google Play がインストールされていません",
+ playNotInstalledHint: "この端末には Google Play ストアがないため、この方法ではアップデートできません。",
+ playReadyHint: "今すぐ再起動して Google Play のアップデートをインストールするか、このまま使い続けられます。",
+ playUnavailable: "Google Play を開けませんでした",
+ playUnavailableHint: "Google Play ストアがこのアップデートのリンクを処理できませんでした。しばらくしてから再試行するか、Web 版のページを開いてください。",
+ ready: "アップデートの準備ができました",
+ readyHint: "再起動するとアップデートが適用されます。",
+ releaseAvailable: "EdgeEver {{version}} が利用可能です。アップデート方法を選んでください。",
+ releaseBuildsOnly: "インストール済みのリリース版で利用できます。",
+ restart: "再起動",
+ restartToApply: "再起動して適用",
+ sources: {
+ github: "GitHub からダウンロード",
+ "google-play": "Google Play でアップデート",
+ },
+ title: "アプリのアップデート",
+ unsupported: "アップデートを確認できません",
+ unsupportedHint: "アップデートの確認はインストール済みのリリース版でのみ利用でき、Expo Go や開発版では利用できません。",
+ updateWithGooglePlay: "Google Play でアップデート",
+ },
+ workspace: {
+ diagramReadOnly: "閲覧専用の図",
+ diagramReadOnlyHint: "ビジュアル図の編集は現在 Web 版とデスクトップ版で利用できます。",
+ },
+ },
} as const;
diff --git a/packages/shared/src/i18n/pl.ts b/packages/shared/src/i18n/pl.ts
index d95a6bb6..79ba3ee9 100644
--- a/packages/shared/src/i18n/pl.ts
+++ b/packages/shared/src/i18n/pl.ts
@@ -3403,4 +3403,187 @@ export const pl = {
resetting: "Resetowanie...",
privacyNotice: "Środowisko demonstracyjne. Nie zapisuj tu prywatnych notatek.",
},
+ // Native mobile client copy.
+ mobile: {
+ ai: {
+ append: "Dołącz",
+ chooseAction: "Wybierz działanie",
+ chooseTargetLanguage: "Wybierz język docelowy",
+ chooseTone: "Wybierz ton",
+ copy: "Kopiuj",
+ draft: "Szkic AI",
+ draftPlaceholder: "Wygenerowany szkic pojawi się tutaj.",
+ generating: "Generowanie…",
+ generationFailed: "Generowanie AI nie powiodło się.",
+ instructionPlaceholder: "Na przykład: zmień strukturę na raport tygodniowy i zachowaj wszystkie dane",
+ intro: "Wybierz, co ma zrobić AI. Wynik pozostaje szkicem, dopóki go nie zastosujesz.",
+ invalidRequest: "Nieprawidłowe żądanie AI.",
+ modelNotConfigured: "Najpierw skonfiguruj model w sekcji Modele i agenci w wersji Web lub desktopowej.",
+ noteUpdateFailed: "Nie udało się zaktualizować notatki.",
+ noteUpdated: "Zaktualizowano notatkę",
+ refinePlaceholder: "Na przykład: bardziej zwięźle",
+ refineResult: "Dopracuj wynik",
+ regenerate: "Generuj ponownie",
+ replace: "Zastąp",
+ signedOut: "AI jest niedostępne bez zalogowania.",
+ },
+ common: {
+ attachmentPrefix: "Załącznik: ",
+ downloaded: "Pobrano",
+ imageLoadFailed: "Nie udało się wczytać obrazu",
+ networkError: "błąd sieci",
+ noteImageLoadFailed: "Nie udało się wczytać obrazu z notatki ({{status}}). Sprawdź połączenie i spróbuj ponownie.",
+ resourceUnavailable: "Nie można teraz odczytać zasobu.",
+ savedFile: "Zapisano: {{filename}}",
+ sharingUnavailable: "Udostępnianie jest niedostępne na tym urządzeniu.",
+ tryAgainLater: "Spróbuj ponownie później.",
+ },
+ imageShare: {
+ advancedJpeg: "Zaawansowany eksport JPEG",
+ advancedPng: "Zaawansowany eksport PNG",
+ backToSettings: "Wróć do ustawień udostępniania",
+ cardWidth: "Szerokość karty",
+ closePreview: "Zamknij podgląd",
+ exportFailed: "Nie udało się wyeksportować obrazu",
+ folderNotWritable: "Nie można zapisywać w tym folderze. Wybierz inny folder w pamięci wewnętrznej, np. „Pictures”.",
+ fontDownloadNotice: "Czcionki do pobrania wymagają połączenia przy pierwszym użyciu i są potem zapisywane w pamięci podręcznej. PuHuiTi i inne polecane czcionki używają pełnych oryginalnych plików, więc pierwsze pobieranie jest większe.",
+ fontSize: "Rozmiar czcionki",
+ format: "Format",
+ generatePreview: "Generuj podgląd",
+ generating: "Generowanie obrazu do udostępnienia",
+ imagesOmitted: "Nie udało się dołączyć obrazów z notatki: {{failed}} z {{total}}.",
+ jpegOption: "JPEG · Mniejszy plik",
+ loadingFont: "Wczytywanie czcionki…",
+ loadingPreview: "Wczytywanie podglądu…",
+ longImageWarning: "To długi obraz. Niektóre aplikacje społecznościowe mogą obniżyć jego jakość, więc zachowaj zapisany oryginał.",
+ openFontPicker: "Otwórz wybór czcionki",
+ pngOption: "PNG · Ostry tekst",
+ preparingImage: "Przygotowywanie obrazu…",
+ preparingNote: "Przygotowywanie notatki…",
+ preview: "Podgląd obrazu",
+ previewUnavailable: "Podgląd niedostępny; nadal możesz wybrać tę czcionkę",
+ renderFailed: "Nie można wyrenderować tego obrazu na tym urządzeniu. Spróbuj mniejszej czcionki lub krótszej notatki.",
+ rendering: "Renderowanie obrazu…",
+ save: "Zapisz obraz",
+ saveFailed: "Nie udało się zapisać",
+ savedTo: "Zapisano w",
+ savingPreview: "Zapisywanie podglądu…",
+ selectedFolder: "Wybrany folder / {{filename}}",
+ share: "Udostępnij",
+ tags: "Tagi",
+ timedOut: "Generowanie obrazu przekroczyło limit czasu. Spróbuj ponownie.",
+ tooLong: "Ta notatka jest za długa na jeden czytelny obraz. Wybierz mniejszą czcionkę lub podziel notatkę.",
+ viewerNotReady: "Notatka nie jest jeszcze gotowa. Spróbuj ponownie.",
+ wide: "Szeroki",
+ },
+ login: {
+ apiNotFound: "Pod tym adresem instancji nie znaleziono API EdgeEver.",
+ authNotConfigured: "Logowanie nie jest skonfigurowane w tej instancji.",
+ cloudflareChallenge: "Weryfikacja przeglądarki Cloudflare zablokowała API logowania. Poproś administratora instancji o dostosowanie reguły WAF Challenge dla API.",
+ databaseNotReady: "Baza danych instancji nie jest gotowa.",
+ failed: "Logowanie nie powiodło się. Spróbuj ponownie później.",
+ invalidCredentials: "Nieprawidłowa nazwa użytkownika lub hasło.",
+ invalidPasswordConfig: "Konfiguracja hasła instancji jest nieprawidłowa.",
+ invalidResponse: "Odpowiedź serwera nie jest prawidłową odpowiedzią EdgeEver.",
+ loginRejected: "Instancja odrzuciła żądanie logowania.",
+ rateLimited: "Zbyt wiele prób logowania. Spróbuj ponownie później.",
+ requestRejected: "Instancja odrzuciła żądanie (HTTP {{status}}).",
+ securityPolicyBlocked: "Polityka bezpieczeństwa zablokowała żądanie, zanim dotarło do EdgeEver. Sprawdź Cloudflare Security Events, Access, WAF lub reguły reverse proxy.",
+ serverError: "Instancja zwróciła błąd serwera (HTTP {{status}}).",
+ unreachable: "Nie można połączyć się z instancją. Sprawdź jej adres i połączenie sieciowe.",
+ },
+ memoDetail: {
+ closeImagePreview: "Zamknij podgląd obrazu",
+ imageActionsHint: "Przytrzymaj, aby otworzyć działania na obrazie",
+ notSignedIn: "Nie zalogowano.",
+ noteActions: "Działania na notatce",
+ noteIdCopied: "Skopiowano ID notatki",
+ noteIdCopyFailed: "Nie udało się skopiować ID notatki",
+ openResourceFailed: "Nie można otworzyć zasobu",
+ shareFailed: "Nie udało się udostępnić",
+ shareNote: "Udostępnij notatkę",
+ },
+ mermaid: {
+ empty: "Ten diagram Mermaid jest pusty.",
+ label: "Diagram Mermaid",
+ renderFailed: "Nie można wyrenderować tego diagramu Mermaid. Sprawdź składnię.",
+ rendering: "Renderowanie diagramu…",
+ },
+ notes: {
+ created: "Utworzono",
+ selectHint: "Przytrzymaj, aby zaznaczyć tę notatkę",
+ updated: "Zaktualizowano",
+ },
+ resources: {
+ attachmentActions: "Działania na załączniku",
+ attachmentUnavailable: "Nie można teraz odczytać załącznika.",
+ shareAttachmentHint: "Otwiera systemowy panel udostępniania dla tego załącznika",
+ waitForSync: "Poczekaj, aż notatka się zsynchronizuje.",
+ },
+ settings: {
+ expoGo: "Expo Go / klient deweloperski",
+ nativeApp: "Aplikacja natywna",
+ standaloneApp: "Samodzielna aplikacja",
+ },
+ systemInfo: {
+ build: "Typ kompilacji",
+ connectionDescription: "Stan połączenia z instancją i lokalnej kolejki synchronizacji.",
+ description: "Wyświetl diagnostykę instancji w chmurze i bieżącego klienta.",
+ developmentBuild: "Deweloperska",
+ existingAttachmentsOriginalStorage: "Odczyt z pierwotnego magazynu",
+ followSystem: "Zgodnie z systemem",
+ openUpdate: "Pobierz aktualizację",
+ platformVersion: "Wersja systemu",
+ productionBuild: "Produkcyjna",
+ updateAvailableDescription: "Dostępna jest nowa wersja. Stuknij, aby zobaczyć szczegóły.",
+ updateAvailableTitle: "Dostępna aktualizacja",
+ },
+ update: {
+ available: "Dostępna aktualizacja",
+ checkForUpdates: "Sprawdź aktualizacje",
+ checking: "Sprawdzanie…",
+ chooseSource: "Wybierz źródło aktualizacji",
+ chooseSourceHint: "Wybierz, gdzie sprawdzić aktualizację aplikacji.",
+ currentVersion: "Bieżąca wersja",
+ description: "EdgeEver automatycznie sprawdza zgodne aktualizacje w aplikacji i nowsze wersje aplikacji.",
+ downloadUpdate: "Pobierz aktualizację",
+ downloading: "Pobieranie…",
+ downloadingUpdate: "Pobieranie aktualizacji…",
+ failed: "Aktualizacja nie powiodła się",
+ failedHint: "Nie udało się pobrać aktualizacji w aplikacji. Spróbuj ponownie później.",
+ installFailed: "Nie udało się zainstalować aktualizacji",
+ installFailedHint: "Spróbuj ponownie lub użyj innego źródła aktualizacji.",
+ later: "Później",
+ linkOpenFailed: "Nie można otworzyć linku",
+ linkOpenFailedHint: "Sprawdź ustawienia przeglądarki i spróbuj ponownie.",
+ none: "Brak aktualizacji",
+ noneHint: "Nie znaleziono aktualizacji w aplikacji do pobrania.",
+ openWebListing: "Otwórz w przeglądarce",
+ playDisabled: "Google Play jest wyłączony",
+ playDisabledHint: "Sklep Google Play jest wyłączony. Włącz go w ustawieniach systemu lub otwórz stronę w przeglądarce.",
+ playNotInstalled: "Brak Google Play",
+ playNotInstalledHint: "Na tym urządzeniu nie ma Sklepu Google Play, więc ten kanał aktualizacji jest niedostępny.",
+ playReadyHint: "Uruchom ponownie teraz, aby zainstalować aktualizację z Google Play, albo korzystaj dalej z aplikacji.",
+ playUnavailable: "Nie można otworzyć Google Play",
+ playUnavailableHint: "Sklep Google Play nie obsłużył tego linku aktualizacji. Spróbuj ponownie później lub otwórz stronę w przeglądarce.",
+ ready: "Aktualizacja gotowa",
+ readyHint: "Uruchom ponownie, aby zastosować aktualizację.",
+ releaseAvailable: "EdgeEver {{version}} jest dostępny. Wybierz źródło aktualizacji.",
+ releaseBuildsOnly: "Dostępne w zainstalowanych wersjach wydania.",
+ restart: "Uruchom ponownie",
+ restartToApply: "Uruchom ponownie, aby zastosować",
+ sources: {
+ github: "Pobierz z GitHub",
+ "google-play": "Zaktualizuj w Google Play",
+ },
+ title: "Aktualizacje aplikacji",
+ unsupported: "Aktualizacje niedostępne",
+ unsupportedHint: "Sprawdzanie aktualizacji działa w zainstalowanych wersjach wydania, nie w Expo Go ani wersjach deweloperskich.",
+ updateWithGooglePlay: "Zaktualizuj przez Google Play",
+ },
+ workspace: {
+ diagramReadOnly: "Diagram tylko do odczytu",
+ diagramReadOnlyHint: "Diagramy wizualne można obecnie edytować w wersji Web i desktopowej.",
+ },
+ },
} as const;
diff --git a/packages/shared/src/i18n/ru.ts b/packages/shared/src/i18n/ru.ts
index 5ffe8322..9110e329 100644
--- a/packages/shared/src/i18n/ru.ts
+++ b/packages/shared/src/i18n/ru.ts
@@ -3414,4 +3414,187 @@ export const ru = {
resetting: "Сброс...",
privacyNotice: "Демо-окружение. Пожалуйста, не сохраняйте личные заметки.",
},
+ // Native mobile client copy.
+ mobile: {
+ ai: {
+ append: "Дописать",
+ chooseAction: "Выберите действие",
+ chooseTargetLanguage: "Выберите язык перевода",
+ chooseTone: "Выберите тон",
+ copy: "Копировать",
+ draft: "Черновик ИИ",
+ draftPlaceholder: "Здесь появится сгенерированный черновик.",
+ generating: "Генерация…",
+ generationFailed: "Не удалось сгенерировать ответ ИИ.",
+ instructionPlaceholder: "Например: переделай это в недельный отчёт и сохрани все данные",
+ intro: "Выберите, что должен сделать ИИ. Результат остаётся черновиком, пока вы его не примените.",
+ invalidRequest: "Некорректный запрос к ИИ.",
+ modelNotConfigured: "Сначала настройте модель в разделе «Модели и агенты» в веб- или десктопном приложении.",
+ noteUpdateFailed: "Не удалось обновить заметку.",
+ noteUpdated: "Заметка обновлена",
+ refinePlaceholder: "Например: сделай короче",
+ refineResult: "Доработать результат",
+ regenerate: "Сгенерировать заново",
+ replace: "Заменить",
+ signedOut: "ИИ недоступен без входа в аккаунт.",
+ },
+ common: {
+ attachmentPrefix: "Вложение: ",
+ downloaded: "Загружено",
+ imageLoadFailed: "Не удалось загрузить изображение",
+ networkError: "ошибка сети",
+ noteImageLoadFailed: "Не удалось загрузить изображение из заметки ({{status}}). Проверьте подключение и повторите попытку.",
+ resourceUnavailable: "Клиент ресурсов недоступен.",
+ savedFile: "Сохранено: {{filename}}",
+ sharingUnavailable: "На этом устройстве нельзя поделиться.",
+ tryAgainLater: "Повторите попытку позже.",
+ },
+ imageShare: {
+ advancedJpeg: "Расширенный экспорт JPEG",
+ advancedPng: "Расширенный экспорт PNG",
+ backToSettings: "Назад к настройкам публикации",
+ cardWidth: "Ширина карточки",
+ closePreview: "Закрыть предпросмотр",
+ exportFailed: "Не удалось экспортировать изображение",
+ folderNotWritable: "В эту папку нельзя сохранять файлы. Выберите папку во внутренней памяти, например «Изображения».",
+ fontDownloadNotice: "Загружаемым шрифтам при первом использовании нужно подключение, затем они кэшируются. PuHuiTi и другие рекомендуемые шрифты загружаются целиком, поэтому первая загрузка больше.",
+ fontSize: "Размер шрифта",
+ format: "Формат",
+ generatePreview: "Создать предпросмотр",
+ generating: "Создание изображения для публикации",
+ imagesOmitted: "Не удалось добавить изображений из заметки: {{failed}} из {{total}}.",
+ jpegOption: "JPEG · Файл меньше",
+ loadingFont: "Загрузка шрифта…",
+ loadingPreview: "Загрузка примера…",
+ longImageWarning: "Это длинное изображение. Некоторые соцсети могут снизить его качество — сохраните оригинал.",
+ openFontPicker: "Открыть выбор шрифта",
+ pngOption: "PNG · Чёткий текст",
+ preparingImage: "Подготовка изображения…",
+ preparingNote: "Подготовка заметки…",
+ preview: "Предпросмотр изображения",
+ previewUnavailable: "Пример недоступен, но шрифт можно выбрать",
+ renderFailed: "Не удалось отрисовать изображение на этом устройстве. Уменьшите размер шрифта или выберите заметку короче.",
+ rendering: "Отрисовка изображения…",
+ save: "Сохранить",
+ saveFailed: "Не удалось сохранить",
+ savedTo: "Сохранено в",
+ savingPreview: "Сохранение предпросмотра…",
+ selectedFolder: "Выбранная папка / {{filename}}",
+ share: "Поделиться",
+ tags: "Теги",
+ timedOut: "Время создания изображения истекло. Повторите попытку.",
+ tooLong: "Заметка слишком длинная для одного читаемого изображения. Уменьшите размер шрифта или разделите заметку.",
+ viewerNotReady: "Просмотр заметки ещё не готов. Повторите попытку.",
+ wide: "Широкая",
+ },
+ login: {
+ apiNotFound: "По этому адресу экземпляра не найден API EdgeEver.",
+ authNotConfigured: "Вход для этого экземпляра не настроен.",
+ cloudflareChallenge: "Проверка браузера Cloudflare перехватила API входа. Попросите администратора экземпляра изменить правило WAF Challenge для API.",
+ databaseNotReady: "База данных экземпляра не готова.",
+ failed: "Не удалось войти. Повторите попытку позже.",
+ invalidCredentials: "Неверное имя пользователя или пароль.",
+ invalidPasswordConfig: "Некорректная настройка пароля экземпляра.",
+ invalidResponse: "Ответ сервера не является корректным ответом EdgeEver.",
+ loginRejected: "Экземпляр отклонил запрос на вход.",
+ rateLimited: "Слишком много попыток входа. Повторите попытку позже.",
+ requestRejected: "Экземпляр отклонил запрос (HTTP {{status}}).",
+ securityPolicyBlocked: "Политика безопасности заблокировала запрос до того, как он дошёл до EdgeEver. Проверьте Cloudflare Security Events, Access, WAF или правила обратного прокси.",
+ serverError: "Экземпляр вернул ошибку сервера (HTTP {{status}}).",
+ unreachable: "Не удаётся подключиться к экземпляру. Проверьте адрес и подключение к сети.",
+ },
+ memoDetail: {
+ closeImagePreview: "Закрыть просмотр изображения",
+ imageActionsHint: "Удерживайте, чтобы открыть действия с изображением",
+ notSignedIn: "Вход не выполнен.",
+ noteActions: "Действия с заметкой",
+ noteIdCopied: "ID заметки скопирован",
+ noteIdCopyFailed: "Не удалось скопировать ID заметки",
+ openResourceFailed: "Не удалось открыть ресурс",
+ shareFailed: "Не удалось поделиться",
+ shareNote: "Поделиться заметкой",
+ },
+ mermaid: {
+ empty: "Диаграмма Mermaid пуста.",
+ label: "Диаграмма Mermaid",
+ renderFailed: "Не удалось отрисовать диаграмму Mermaid. Проверьте синтаксис.",
+ rendering: "Отрисовка диаграммы…",
+ },
+ notes: {
+ created: "Создано",
+ selectHint: "Удерживайте, чтобы выбрать заметку",
+ updated: "Изменено",
+ },
+ resources: {
+ attachmentActions: "Действия с вложением",
+ attachmentUnavailable: "Клиент вложений недоступен.",
+ shareAttachmentHint: "Открывает системное меню «Поделиться» для этого вложения",
+ waitForSync: "Сначала дождитесь синхронизации заметки.",
+ },
+ settings: {
+ expoGo: "Expo Go / клиент разработки",
+ nativeApp: "Нативное приложение",
+ standaloneApp: "Отдельное приложение",
+ },
+ systemInfo: {
+ build: "Тип сборки",
+ connectionDescription: "Состояние подключения и локальной очереди синхронизации.",
+ description: "Диагностика облачного экземпляра и текущего клиента.",
+ developmentBuild: "Разработка",
+ existingAttachmentsOriginalStorage: "Читаются из исходного хранилища",
+ followSystem: "Как в системе",
+ openUpdate: "Получить обновление",
+ platformVersion: "Версия системы",
+ productionBuild: "Релиз",
+ updateAvailableDescription: "Доступна новая версия. Нажмите, чтобы узнать подробности.",
+ updateAvailableTitle: "Доступно обновление",
+ },
+ update: {
+ available: "Доступно обновление",
+ checkForUpdates: "Проверить обновления",
+ checking: "Проверка…",
+ chooseSource: "Выбрать источник обновления",
+ chooseSourceHint: "Выберите, где проверить обновление приложения.",
+ currentVersion: "Текущая версия",
+ description: "EdgeEver автоматически проверяет совместимые обновления внутри приложения и новые версии приложения.",
+ downloadUpdate: "Скачать обновление",
+ downloading: "Загрузка…",
+ downloadingUpdate: "Загрузка обновления…",
+ failed: "Не удалось обновить",
+ failedHint: "Не удалось загрузить обновление внутри приложения. Повторите попытку позже.",
+ installFailed: "Не удалось установить обновление",
+ installFailedHint: "Повторите попытку или воспользуйтесь другим источником обновления.",
+ later: "Позже",
+ linkOpenFailed: "Не удалось открыть ссылку",
+ linkOpenFailedHint: "Проверьте настройки браузера и повторите попытку.",
+ none: "Обновлений нет",
+ noneHint: "Не найдено обновлений, доступных для загрузки внутри приложения.",
+ openWebListing: "Открыть страницу в браузере",
+ playDisabled: "Google Play отключён",
+ playDisabledHint: "Google Play Store отключён. Включите его в настройках системы или откройте страницу приложения в браузере.",
+ playNotInstalled: "Google Play не установлен",
+ playNotInstalledHint: "На этом устройстве не установлен Google Play Store, поэтому этот способ обновления недоступен.",
+ playReadyHint: "Перезапустите приложение, чтобы установить обновление из Google Play, или продолжайте работу.",
+ playUnavailable: "Не удалось открыть Google Play",
+ playUnavailableHint: "Google Play Store не смог открыть ссылку на обновление. Повторите попытку позже или откройте страницу приложения в браузере.",
+ ready: "Обновление готово",
+ readyHint: "Перезапустите приложение, чтобы применить обновление.",
+ releaseAvailable: "Доступна версия EdgeEver {{version}}. Выберите, откуда обновить.",
+ releaseBuildsOnly: "Доступно в установленных релизных сборках.",
+ restart: "Перезапустить",
+ restartToApply: "Перезапустить для применения",
+ sources: {
+ github: "Скачать с GitHub",
+ "google-play": "Обновить в Google Play",
+ },
+ title: "Обновления приложения",
+ unsupported: "Обновления недоступны",
+ unsupportedHint: "Проверка обновлений доступна в установленных релизных сборках, а не в Expo Go или сборках для разработки.",
+ updateWithGooglePlay: "Обновить через Google Play",
+ },
+ workspace: {
+ diagramReadOnly: "Диаграмма только для просмотра",
+ diagramReadOnlyHint: "Визуальное редактирование диаграмм сейчас доступно в веб- и десктопном приложениях.",
+ },
+ },
} as const;
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index f1f05e51..ad8d4926 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -3412,4 +3412,187 @@ export const zhCN = {
resetting: "正在重置...",
privacyNotice: "当前为演示环境,请勿保存私密笔记。",
},
+ // Native mobile client copy.
+ mobile: {
+ ai: {
+ append: "追加",
+ chooseAction: "选择处理方式",
+ chooseTargetLanguage: "选择目标语言",
+ chooseTone: "选择语气",
+ copy: "复制",
+ draft: "AI 草稿",
+ draftPlaceholder: "生成的草稿会显示在这里。",
+ generating: "生成中…",
+ generationFailed: "AI 生成失败。",
+ instructionPlaceholder: "例如:改成适合周报的结构,保留所有数据",
+ intro: "选择 AI 要做的事。输出只会作为草稿,确认后才会修改笔记。",
+ invalidRequest: "AI 请求无效。",
+ modelNotConfigured: "请先在 Web 或桌面端的“模型与代理”中配置模型。",
+ noteUpdateFailed: "更新笔记失败。",
+ noteUpdated: "已更新笔记",
+ refinePlaceholder: "例如:再简洁一点",
+ refineResult: "继续调整",
+ regenerate: "重新生成",
+ replace: "替换",
+ signedOut: "当前未登录,无法使用 AI。",
+ },
+ common: {
+ attachmentPrefix: "附件:",
+ downloaded: "下载成功",
+ imageLoadFailed: "图片加载失败",
+ networkError: "网络错误",
+ noteImageLoadFailed: "笔记中的图片未能加载({{status}})。请检查网络后重试。",
+ resourceUnavailable: "当前无法读取资源。",
+ savedFile: "已保存:{{filename}}",
+ sharingUnavailable: "当前设备无法打开系统分享面板。",
+ tryAgainLater: "请稍后重试。",
+ },
+ imageShare: {
+ advancedJpeg: "高级导出 JPEG",
+ advancedPng: "高级导出 PNG",
+ backToSettings: "返回分享设置",
+ cardWidth: "卡片宽度",
+ closePreview: "关闭预览",
+ exportFailed: "导出笔记图片失败",
+ folderNotWritable: "此文件夹无法写入。请选择内部存储中的其他文件夹,例如“Pictures”。",
+ fontDownloadNotice: "下载型字体首次使用需联网,下载后缓存;普惠体等推荐字体保留完整文件,首次下载较大。",
+ fontSize: "字号大小",
+ format: "格式",
+ generatePreview: "生成预览",
+ generating: "正在生成分享图片",
+ imagesOmitted: "笔记中的 {{total}} 张图片有 {{failed}} 张未能包含。",
+ jpegOption: "JPEG · 体积小",
+ loadingFont: "字体加载中…",
+ loadingPreview: "正在加载示例…",
+ longImageWarning: "图片较长,部分社交平台可能会压缩画质;建议保留保存的原图。",
+ openFontPicker: "打开字体选择列表",
+ pngOption: "PNG · 超清无损",
+ preparingImage: "正在准备图片…",
+ preparingNote: "正在准备笔记…",
+ preview: "图片预览",
+ previewUnavailable: "示例暂不可用,仍可选择",
+ renderFailed: "这台设备无法渲染这张图片。请调小导出字号,或缩短笔记后重试。",
+ rendering: "正在渲染图片…",
+ save: "保存图片",
+ saveFailed: "保存失败",
+ savedTo: "图片已保存至",
+ savingPreview: "正在保存预览…",
+ selectedFolder: "所选文件夹 / {{filename}}",
+ share: "系统分享",
+ tags: "标签",
+ timedOut: "生成图片超时,请重试。",
+ tooLong: "这篇笔记太长,无法生成清晰的单张图片。请调小导出字号,或拆分笔记后重试。",
+ viewerNotReady: "笔记尚未准备好,请重试。",
+ wide: "宽屏",
+ },
+ login: {
+ apiNotFound: "该实例地址没有找到 EdgeEver API,请检查地址。",
+ authNotConfigured: "这个实例还没有配置登录功能。",
+ cloudflareChallenge: "Cloudflare 人机验证拦截了登录接口。请实例管理员调整针对 API 的 WAF Challenge 规则。",
+ databaseNotReady: "实例数据库尚未就绪。",
+ failed: "登录失败,请稍后再试。",
+ invalidCredentials: "用户名或密码不正确。",
+ invalidPasswordConfig: "实例的密码配置无效。",
+ invalidResponse: "服务端返回的内容不是有效的 EdgeEver 响应。",
+ loginRejected: "实例拒绝了登录请求。",
+ rateLimited: "登录尝试次数过多,请稍后再试。",
+ requestRejected: "实例拒绝了请求(HTTP {{status}})。",
+ securityPolicyBlocked: "登录请求在到达 EdgeEver 前被安全策略拦截。请检查 Cloudflare Security Events、Access、WAF 或反向代理规则。",
+ serverError: "实例服务异常(HTTP {{status}})。",
+ unreachable: "无法连接实例,请检查实例地址和网络连接。",
+ },
+ memoDetail: {
+ closeImagePreview: "关闭图片预览",
+ imageActionsHint: "长按打开图片操作",
+ notSignedIn: "未登录。",
+ noteActions: "笔记操作",
+ noteIdCopied: "笔记 ID 已复制",
+ noteIdCopyFailed: "复制笔记 ID 失败",
+ openResourceFailed: "无法打开资源",
+ shareFailed: "分享失败",
+ shareNote: "分享笔记",
+ },
+ mermaid: {
+ empty: "此 Mermaid 图表暂无内容。",
+ label: "Mermaid 图表",
+ renderFailed: "无法渲染此 Mermaid 图表,请检查语法。",
+ rendering: "正在渲染图表…",
+ },
+ notes: {
+ created: "创建",
+ selectHint: "长按选择这条笔记",
+ updated: "更新",
+ },
+ resources: {
+ attachmentActions: "附件操作",
+ attachmentUnavailable: "当前无法读取附件。",
+ shareAttachmentHint: "打开系统分享面板分享此附件",
+ waitForSync: "请等待笔记同步完成。",
+ },
+ settings: {
+ expoGo: "Expo Go / 开发客户端",
+ nativeApp: "原生应用",
+ standaloneApp: "独立安装包",
+ },
+ systemInfo: {
+ build: "构建类型",
+ connectionDescription: "实例连接与本地同步队列状态。",
+ description: "查看云端实例与当前客户端的诊断信息。",
+ developmentBuild: "开发版",
+ existingAttachmentsOriginalStorage: "继续从原存储读取",
+ followSystem: "跟随系统",
+ openUpdate: "前往更新",
+ platformVersion: "系统版本",
+ productionBuild: "正式版",
+ updateAvailableDescription: "发现新版本,点按查看详情。",
+ updateAvailableTitle: "发现新版本",
+ },
+ update: {
+ available: "发现新版本",
+ checkForUpdates: "检查更新",
+ checking: "正在检查…",
+ chooseSource: "选择更新渠道",
+ chooseSourceHint: "请选择检查应用更新的渠道。",
+ currentVersion: "当前版本",
+ description: "EdgeEver 会自动检查兼容的应用内热更新和新版应用。",
+ downloadUpdate: "下载更新",
+ downloading: "正在下载…",
+ downloadingUpdate: "正在下载更新…",
+ failed: "更新失败",
+ failedHint: "无法下载应用内更新,请稍后再试。",
+ installFailed: "无法安装更新",
+ installFailedHint: "请重试,或使用现有更新渠道。",
+ later: "稍后",
+ linkOpenFailed: "无法打开链接",
+ linkOpenFailedHint: "请检查浏览器设置后重试。",
+ none: "暂无更新",
+ noneHint: "没有可下载的应用内更新。",
+ openWebListing: "打开网页版",
+ playDisabled: "Google Play 已停用",
+ playDisabledHint: "Google Play 商店已被停用,请先在系统设置中启用,或改用网页版。",
+ playNotInstalled: "未安装 Google Play",
+ playNotInstalledHint: "这台设备未安装 Google Play 商店,无法通过该渠道更新。",
+ playReadyHint: "重启即可安装 Google Play 更新,也可以稍后继续使用。",
+ playUnavailable: "无法打开 Google Play",
+ playUnavailableHint: "Google Play 商店无法处理这个更新链接,请稍后重试,或改用网页版。",
+ ready: "更新已就绪",
+ readyHint: "重启后即可应用更新。",
+ releaseAvailable: "EdgeEver {{version}} 已发布,请选择更新渠道。",
+ releaseBuildsOnly: "此功能会在已安装的正式版中启用。",
+ restart: "立即重启",
+ restartToApply: "重启以应用",
+ sources: {
+ github: "从 GitHub 下载",
+ "google-play": "在 Google Play 更新",
+ },
+ title: "应用更新",
+ unsupported: "暂无法检查更新",
+ unsupportedHint: "检查更新仅适用于已安装的正式版,Expo Go 和开发版暂不支持。",
+ updateWithGooglePlay: "通过 Google Play 更新",
+ },
+ workspace: {
+ diagramReadOnly: "图表暂为只读",
+ diagramReadOnlyHint: "可视化图表目前请在 Web 或桌面端编辑。",
+ },
+ },
} as const;
diff --git a/packages/shared/src/mobile-editor.test.mjs b/packages/shared/src/mobile-editor.test.mjs
index 319cc513..7e035d09 100644
--- a/packages/shared/src/mobile-editor.test.mjs
+++ b/packages/shared/src/mobile-editor.test.mjs
@@ -2,6 +2,7 @@ import { describe, expect, test } from "bun:test";
import {
MOBILE_EDITOR_ACTIVE_FLAGS,
MOBILE_EDITOR_TOOLBAR_ACTIONS,
+ getMobileEditorCopy,
getMobileEditorInputAttributes,
getMobileEditorImageScaleLabel,
getMobileEditorImageWidthPresetLabel,
@@ -55,3 +56,24 @@ describe("mobile editor contract", () => {
});
});
});
+
+const collectCopyKeys = (value, prefix = "") =>
+ typeof value === "string"
+ ? [prefix]
+ : Object.entries(value).flatMap(([key, child]) => collectCopyKeys(child, prefix ? `${prefix}.${key}` : key));
+
+describe("mobile editor copy", () => {
+ test("ships the same keys for every locale", () => {
+ const englishKeys = collectCopyKeys(getMobileEditorCopy("en-US"));
+ for (const locale of ["zh-CN", "ja", "pl", "ru"]) {
+ expect({ locale, keys: collectCopyKeys(getMobileEditorCopy(locale)) }).toEqual({ locale, keys: englishKeys });
+ }
+ });
+
+ test("localizes editor overlays instead of falling back to English", () => {
+ expect(getMobileEditorCopy("pl").codeBlock.copy).toBe("Kopiuj kod");
+ expect(getMobileEditorCopy("ja").codeBlock.copy).toBe("コードをコピー");
+ expect(getMobileEditorCopy("zh-CN").codeBlock.copy).toBe("复制代码");
+ expect(getMobileEditorCopy("ru").codeBlock.copy).toBe("Копировать код");
+ });
+});
diff --git a/packages/shared/src/mobile-editor.ts b/packages/shared/src/mobile-editor.ts
index bd40984a..adb3f1e4 100644
--- a/packages/shared/src/mobile-editor.ts
+++ b/packages/shared/src/mobile-editor.ts
@@ -62,6 +62,94 @@ const MOBILE_EDITOR_COPY = {
large: "较大",
full: "铺满",
},
+ attachmentPrefix: "附件:",
+ close: "关闭",
+ ai: {
+ generationFailed: "AI 生成失败。",
+ promptMissing: "所选指令已不存在,请重新选择。",
+ selectionExpired: "笔记内容已变化,选区已失效,请重新选择文本。",
+ openForNote: "用 AI 处理正文或选中内容",
+ openForSelection: "用 AI 处理选中内容",
+ emptyNote: "请先输入正文内容。",
+ selectionUpdated: "AI 已更新选中内容。",
+ actions: {
+ summarize: "精简总结",
+ "extract-key-points": "提炼要点",
+ "extract-todos": "提取待办",
+ "rewrite-proofread": "改写与校对",
+ translate: "全文翻译",
+ "improve-writing": "润色表达",
+ "fix-spelling-grammar": "修正错别字与语法",
+ "make-shorter": "精炼表达",
+ "make-longer": "扩写内容",
+ "simplify-language": "简化表达",
+ "change-tone": "改变语气",
+ "continue-writing": "继续写作",
+ custom: "自定义指令",
+ },
+ languages: {
+ en: "英语",
+ "zh-CN": "简体中文",
+ "zh-TW": "繁体中文",
+ ja: "日语",
+ ko: "韩语",
+ es: "西班牙语",
+ fr: "法语",
+ de: "德语",
+ pt: "葡萄牙语",
+ pl: "波兰语",
+ },
+ tones: {
+ professional: "专业",
+ friendly: "友好",
+ casual: "轻松",
+ direct: "直接",
+ },
+ chooseAction: "选择处理方式",
+ chooseTargetLanguage: "选择目标语言",
+ chooseTone: "选择语气",
+ noteTitle: "AI 全文助手",
+ selectionTitle: "AI 选区助手",
+ noteScopeHint: "未选择文字,将处理整篇正文。",
+ selectionScopeHint: "只处理当前选中的正文。",
+ action: "处理方式",
+ targetLanguage: "目标语言",
+ tone: "语气",
+ instruction: "告诉 AI 你想怎么处理",
+ instructionPlaceholder: "例如:改写成一封简洁的邮件。",
+ draft: "AI 草稿",
+ generating: "生成中…",
+ draftPlaceholder: "生成的草稿会显示在这里。",
+ refineResult: "继续调整",
+ refinePlaceholder: "例如:再简洁一点",
+ refine: "调整",
+ insertAfter: "插入到选区后",
+ replaceSelection: "替换选中内容",
+ stop: "停止",
+ regenerate: "重新生成",
+ generate: "生成",
+ },
+ codeBlock: {
+ mermaidPreview: "Mermaid 图表预览",
+ copy: "复制代码",
+ copied: "已复制",
+ copyFailed: "复制失败",
+ mermaidSource: "Mermaid 源码",
+ codeSource: "代码源码",
+ mermaidEmpty: "请在下方输入 Mermaid 源码。",
+ rendering: "正在渲染图表…",
+ renderFailed: "无法渲染此图表,请检查语法。",
+ },
+ diagram: {
+ mindMap: "思维导图",
+ architecture: "架构图",
+ flowchart: "流程图",
+ },
+ image: {
+ loadFailed: "图片加载失败",
+ uploading: "图片上传中…",
+ actions: "图片操作",
+ },
},
"en-US": {
placeholder: "Start writing...",
@@ -85,6 +173,94 @@ const MOBILE_EDITOR_COPY = {
large: "Large",
full: "Full",
},
+ attachmentPrefix: "Attachment: ",
+ close: "Close",
+ ai: {
+ generationFailed: "AI generation failed.",
+ promptMissing: "The selected prompt no longer exists. Choose another prompt.",
+ selectionExpired: "The selection expired because the note changed. Select the text again.",
+ openForNote: "Use AI on the note or selected text",
+ openForSelection: "Use AI on selected text",
+ emptyNote: "Add some note content first.",
+ selectionUpdated: "AI updated the selection.",
+ actions: {
+ summarize: "Summarize",
+ "extract-key-points": "Key points",
+ "extract-todos": "Extract tasks",
+ "rewrite-proofread": "Rewrite & proofread",
+ translate: "Translate",
+ "improve-writing": "Polish",
+ "fix-spelling-grammar": "Fix spelling & grammar",
+ "make-shorter": "Make concise",
+ "make-longer": "Make longer",
+ "simplify-language": "Simplify language",
+ "change-tone": "Change tone",
+ "continue-writing": "Continue writing",
+ custom: "Custom prompt",
+ },
+ languages: {
+ en: "English",
+ "zh-CN": "Simplified Chinese",
+ "zh-TW": "Traditional Chinese",
+ ja: "Japanese",
+ ko: "Korean",
+ es: "Spanish",
+ fr: "French",
+ de: "German",
+ pt: "Portuguese",
+ pl: "Polish",
+ },
+ tones: {
+ professional: "Professional",
+ friendly: "Friendly",
+ casual: "Casual",
+ direct: "Direct",
+ },
+ chooseAction: "Choose an action",
+ chooseTargetLanguage: "Choose target language",
+ chooseTone: "Choose tone",
+ noteTitle: "AI whole-note assistant",
+ selectionTitle: "AI selection assistant",
+ noteScopeHint: "No text selected; the whole note will be processed.",
+ selectionScopeHint: "Only the selected text will be processed.",
+ action: "Action",
+ targetLanguage: "Target language",
+ tone: "Tone",
+ instruction: "Tell AI what to do",
+ instructionPlaceholder: "For example: Rewrite this as a concise email.",
+ draft: "AI draft",
+ generating: "Generating…",
+ draftPlaceholder: "The generated draft will appear here.",
+ refineResult: "Refine result",
+ refinePlaceholder: "Make it more concise",
+ refine: "Refine",
+ insertAfter: "Insert after",
+ replaceSelection: "Replace selection",
+ stop: "Stop",
+ regenerate: "Regenerate",
+ generate: "Generate",
+ },
+ codeBlock: {
+ mermaidPreview: "Mermaid diagram preview",
+ copy: "Copy code",
+ copied: "Copied",
+ copyFailed: "Copy failed",
+ mermaidSource: "Mermaid source",
+ codeSource: "Code source",
+ mermaidEmpty: "Enter Mermaid source below.",
+ rendering: "Rendering diagram…",
+ renderFailed: "Unable to render this diagram. Check its syntax.",
+ },
+ diagram: {
+ mindMap: "Mind map",
+ architecture: "Architecture diagram",
+ flowchart: "Flowchart",
+ },
+ image: {
+ loadFailed: "Image failed to load",
+ uploading: "Uploading image…",
+ actions: "Image actions",
+ },
},
ja: {
placeholder: "書き始める...",
@@ -108,6 +284,94 @@ const MOBILE_EDITOR_COPY = {
large: "大",
full: "幅いっぱい",
},
+ attachmentPrefix: "添付: ",
+ close: "閉じる",
+ ai: {
+ generationFailed: "AI の生成に失敗しました。",
+ promptMissing: "選択したプロンプトはもう存在しません。別のプロンプトを選んでください。",
+ selectionExpired: "ノートが変更されたため選択範囲が無効になりました。もう一度テキストを選択してください。",
+ openForNote: "ノートまたは選択したテキストに AI を使う",
+ openForSelection: "選択したテキストに AI を使う",
+ emptyNote: "先にノートの本文を入力してください。",
+ selectionUpdated: "AI が選択範囲を更新しました。",
+ actions: {
+ summarize: "要約",
+ "extract-key-points": "要点",
+ "extract-todos": "タスクを抽出",
+ "rewrite-proofread": "書き直しと校正",
+ translate: "翻訳",
+ "improve-writing": "推敲",
+ "fix-spelling-grammar": "スペルと文法を直す",
+ "make-shorter": "簡潔にする",
+ "make-longer": "長くする",
+ "simplify-language": "表現をやさしくする",
+ "change-tone": "トーンを変える",
+ "continue-writing": "続きを書く",
+ custom: "カスタムプロンプト",
+ },
+ languages: {
+ en: "英語",
+ "zh-CN": "簡体字中国語",
+ "zh-TW": "繁体字中国語",
+ ja: "日本語",
+ ko: "韓国語",
+ es: "スペイン語",
+ fr: "フランス語",
+ de: "ドイツ語",
+ pt: "ポルトガル語",
+ pl: "ポーランド語",
+ },
+ tones: {
+ professional: "フォーマル",
+ friendly: "フレンドリー",
+ casual: "カジュアル",
+ direct: "率直",
+ },
+ chooseAction: "操作を選択",
+ chooseTargetLanguage: "翻訳先の言語を選択",
+ chooseTone: "トーンを選択",
+ noteTitle: "AI ノート全体アシスタント",
+ selectionTitle: "AI 選択範囲アシスタント",
+ noteScopeHint: "テキストが選択されていないため、ノート全体を処理します。",
+ selectionScopeHint: "選択したテキストだけを処理します。",
+ action: "操作",
+ targetLanguage: "対象言語",
+ tone: "トーン",
+ instruction: "AI に何をしてほしいか伝える",
+ instructionPlaceholder: "例:簡潔なメールに書き直す。",
+ draft: "AI の下書き",
+ generating: "生成中…",
+ draftPlaceholder: "生成された下書きがここに表示されます。",
+ refineResult: "結果を調整",
+ refinePlaceholder: "例:もっと簡潔に",
+ refine: "調整",
+ insertAfter: "選択範囲の後に挿入",
+ replaceSelection: "選択範囲を置き換え",
+ stop: "停止",
+ regenerate: "再生成",
+ generate: "生成",
+ },
+ codeBlock: {
+ mermaidPreview: "Mermaid 図のプレビュー",
+ copy: "コードをコピー",
+ copied: "コピーしました",
+ copyFailed: "コピーできませんでした",
+ mermaidSource: "Mermaid ソース",
+ codeSource: "コードのソース",
+ mermaidEmpty: "下に Mermaid のソースを入力してください。",
+ rendering: "図をレンダリング中…",
+ renderFailed: "この図をレンダリングできません。構文を確認してください。",
+ },
+ diagram: {
+ mindMap: "マインドマップ",
+ architecture: "アーキテクチャ図",
+ flowchart: "フローチャート",
+ },
+ image: {
+ loadFailed: "画像を読み込めませんでした",
+ uploading: "画像をアップロード中…",
+ actions: "画像の操作",
+ },
},
pl: {
placeholder: "Zacznij pisać...",
@@ -131,6 +395,94 @@ const MOBILE_EDITOR_COPY = {
large: "Duży",
full: "Pełna szerokość",
},
+ attachmentPrefix: "Załącznik: ",
+ close: "Zamknij",
+ ai: {
+ generationFailed: "Generowanie AI nie powiodło się.",
+ promptMissing: "Wybrane polecenie już nie istnieje. Wybierz inne.",
+ selectionExpired: "Notatka się zmieniła, więc zaznaczenie wygasło. Zaznacz tekst ponownie.",
+ openForNote: "Użyj AI na notatce lub zaznaczonym tekście",
+ openForSelection: "Użyj AI na zaznaczonym tekście",
+ emptyNote: "Najpierw dodaj treść notatki.",
+ selectionUpdated: "AI zaktualizowało zaznaczenie.",
+ actions: {
+ summarize: "Podsumuj",
+ "extract-key-points": "Najważniejsze punkty",
+ "extract-todos": "Wyodrębnij zadania",
+ "rewrite-proofread": "Przeredaguj i popraw",
+ translate: "Przetłumacz",
+ "improve-writing": "Dopracuj",
+ "fix-spelling-grammar": "Popraw pisownię i gramatykę",
+ "make-shorter": "Skróć",
+ "make-longer": "Wydłuż",
+ "simplify-language": "Uprość język",
+ "change-tone": "Zmień ton",
+ "continue-writing": "Pisz dalej",
+ custom: "Własny prompt",
+ },
+ languages: {
+ en: "Angielski",
+ "zh-CN": "Chiński uproszczony",
+ "zh-TW": "Chiński tradycyjny",
+ ja: "Japoński",
+ ko: "Koreański",
+ es: "Hiszpański",
+ fr: "Francuski",
+ de: "Niemiecki",
+ pt: "Portugalski",
+ pl: "Polski",
+ },
+ tones: {
+ professional: "Profesjonalny",
+ friendly: "Przyjazny",
+ casual: "Swobodny",
+ direct: "Bezpośredni",
+ },
+ chooseAction: "Wybierz działanie",
+ chooseTargetLanguage: "Wybierz język docelowy",
+ chooseTone: "Wybierz ton",
+ noteTitle: "Asystent AI całej notatki",
+ selectionTitle: "Asystent AI zaznaczenia",
+ noteScopeHint: "Nie zaznaczono tekstu, więc zostanie przetworzona cała notatka.",
+ selectionScopeHint: "Zostanie przetworzony tylko zaznaczony tekst.",
+ action: "Działanie",
+ targetLanguage: "Język docelowy",
+ tone: "Ton",
+ instruction: "Powiedz AI, co ma zrobić",
+ instructionPlaceholder: "Na przykład: przepisz to jako zwięzłego e-maila.",
+ draft: "Szkic AI",
+ generating: "Generowanie…",
+ draftPlaceholder: "Wygenerowany szkic pojawi się tutaj.",
+ refineResult: "Dopracuj wynik",
+ refinePlaceholder: "Na przykład: bardziej zwięźle",
+ refine: "Dopracuj",
+ insertAfter: "Wstaw po zaznaczeniu",
+ replaceSelection: "Zastąp zaznaczenie",
+ stop: "Zatrzymaj",
+ regenerate: "Generuj ponownie",
+ generate: "Generuj",
+ },
+ codeBlock: {
+ mermaidPreview: "Podgląd diagramu Mermaid",
+ copy: "Kopiuj kod",
+ copied: "Skopiowano",
+ copyFailed: "Nie udało się skopiować",
+ mermaidSource: "Źródło Mermaid",
+ codeSource: "Kod źródłowy",
+ mermaidEmpty: "Wpisz poniżej kod źródłowy Mermaid.",
+ rendering: "Renderowanie diagramu…",
+ renderFailed: "Nie można wyrenderować tego diagramu. Sprawdź składnię.",
+ },
+ diagram: {
+ mindMap: "Mapa myśli",
+ architecture: "Diagram architektury",
+ flowchart: "Schemat blokowy",
+ },
+ image: {
+ loadFailed: "Nie udało się wczytać obrazu",
+ uploading: "Przesyłanie obrazu…",
+ actions: "Działania na obrazie",
+ },
},
ru: {
placeholder: "Начните запись...",
@@ -154,9 +506,99 @@ const MOBILE_EDITOR_COPY = {
large: "Большой",
full: "На всю ширину",
},
+ attachmentPrefix: "Вложение: ",
+ close: "Закрыть",
+ ai: {
+ generationFailed: "Не удалось сгенерировать ответ ИИ.",
+ promptMissing: "Выбранный промпт больше не существует. Выберите другой.",
+ selectionExpired: "Выделение сброшено, потому что заметка изменилась. Выделите текст снова.",
+ openForNote: "Применить ИИ к заметке или выделенному тексту",
+ openForSelection: "Применить ИИ к выделенному тексту",
+ emptyNote: "Сначала добавьте текст заметки.",
+ selectionUpdated: "ИИ обновил выделенный текст.",
+ actions: {
+ summarize: "Кратко",
+ "extract-key-points": "Ключевые мысли",
+ "extract-todos": "Выделить задачи",
+ "rewrite-proofread": "Переписать и вычитать",
+ translate: "Перевести",
+ "improve-writing": "Улучшить стиль",
+ "fix-spelling-grammar": "Исправить орфографию и грамматику",
+ "make-shorter": "Сделать короче",
+ "make-longer": "Сделать длиннее",
+ "simplify-language": "Упростить язык",
+ "change-tone": "Изменить тон",
+ "continue-writing": "Продолжить текст",
+ custom: "Свой промпт",
+ },
+ languages: {
+ en: "Английский",
+ "zh-CN": "Упрощённый китайский",
+ "zh-TW": "Традиционный китайский",
+ ja: "Японский",
+ ko: "Корейский",
+ es: "Испанский",
+ fr: "Французский",
+ de: "Немецкий",
+ pt: "Португальский",
+ pl: "Польский",
+ },
+ tones: {
+ professional: "Деловой",
+ friendly: "Дружелюбный",
+ casual: "Неформальный",
+ direct: "Прямой",
+ },
+ chooseAction: "Выберите действие",
+ chooseTargetLanguage: "Выберите язык перевода",
+ chooseTone: "Выберите тон",
+ noteTitle: "ИИ-помощник для всей заметки",
+ selectionTitle: "ИИ-помощник для выделения",
+ noteScopeHint: "Текст не выделен — будет обработана вся заметка.",
+ selectionScopeHint: "Будет обработан только выделенный текст.",
+ action: "Действие",
+ targetLanguage: "Язык перевода",
+ tone: "Тон",
+ instruction: "Опишите, что сделать ИИ",
+ instructionPlaceholder: "Например: перепиши это как короткое письмо.",
+ draft: "Черновик ИИ",
+ generating: "Генерация…",
+ draftPlaceholder: "Здесь появится сгенерированный черновик.",
+ refineResult: "Доработать результат",
+ refinePlaceholder: "Например: сделай короче",
+ refine: "Доработать",
+ insertAfter: "Вставить после",
+ replaceSelection: "Заменить выделение",
+ stop: "Остановить",
+ regenerate: "Сгенерировать заново",
+ generate: "Сгенерировать",
+ },
+ codeBlock: {
+ mermaidPreview: "Предпросмотр диаграммы Mermaid",
+ copy: "Копировать код",
+ copied: "Скопировано",
+ copyFailed: "Не удалось скопировать",
+ mermaidSource: "Исходный код Mermaid",
+ codeSource: "Исходный код",
+ mermaidEmpty: "Введите исходный код Mermaid ниже.",
+ rendering: "Отрисовка диаграммы…",
+ renderFailed: "Не удалось отрисовать диаграмму. Проверьте синтаксис.",
+ },
+ diagram: {
+ mindMap: "Интеллект-карта",
+ architecture: "Архитектурная схема",
+ flowchart: "Блок-схема",
+ },
+ image: {
+ loadFailed: "Не удалось загрузить изображение",
+ uploading: "Загрузка изображения…",
+ actions: "Действия с изображением",
+ },
},
} as const;
+export const getMobileEditorCopy = (locale: MobileEditorLocale) => MOBILE_EDITOR_COPY[locale];
+
export const getMobileEditorPlaceholder = (locale: MobileEditorLocale): string =>
MOBILE_EDITOR_COPY[locale].placeholder;
diff --git a/tests/mobile-ai-assistant.test.ts b/tests/mobile-ai-assistant.test.ts
index 6c86b8f6..1eadc30a 100644
--- a/tests/mobile-ai-assistant.test.ts
+++ b/tests/mobile-ai-assistant.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, test } from "bun:test";
import { readFileSync } from "node:fs";
+import { enUS } from "../packages/shared/src/i18n/en-US";
const readSource = (path: string) => readFileSync(new URL(path, import.meta.url), "utf8");
@@ -26,8 +27,9 @@ describe("native mobile AI note assistant", () => {
"rewrite-proofread",
"translate",
]) {
- expect(androidAssistantSource).toContain(`"${action}"`);
+ expect(Object.keys(enUS.aiAssistant.actions)).toContain(action);
}
+ expect(androidAssistantSource).toContain("getMobileCatalog(resolvedLocale).aiAssistant.actions");
for (const action of [
"case summarize",
@@ -79,7 +81,7 @@ describe("native mobile AI note assistant", () => {
});
test("keeps the assistant reachable from each native note action menu", () => {
- expect(androidDetailSource).toContain('label={resolvedLocale !== "zh-CN" ? "AI note assistant" : "AI 笔记助手"}');
+ expect(androidDetailSource).toContain("label={getMobileCatalog(resolvedLocale).aiAssistant.title}");
expect(androidDetailSource).toContain("setAiAssistantOpen(true)");
expect(androidDetailSource).toContain("<MobileAiAssistantModal");
expect(iosDetailSource).toContain('env.preferences.t("AI 笔记助手", en: "AI note assistant"');
diff --git a/tests/mobile-app-scope.test.ts b/tests/mobile-app-scope.test.ts
index 644063d5..c4c27770 100644
--- a/tests/mobile-app-scope.test.ts
+++ b/tests/mobile-app-scope.test.ts
@@ -91,7 +91,7 @@ describe("mobile app scope", () => {
test("keeps version history reachable from an active note", () => {
expect(memoDetailSource).toContain("{!memo.isDeleted ? (");
- expect(memoDetailSource).toContain('label={resolvedLocale !== "zh-CN" ? "Version history" : "版本历史"}');
+ expect(memoDetailSource).toContain("label={getMobileCatalog(resolvedLocale).editor.versionHistory}");
expect(memoDetailSource).toContain("onPress={() => closeActionsAndRun(() => onOpenRevisions(memo))}");
expect(memoDetailSource).toContain('syncStatus === "conflict"');
expect(memoDetailSource).toContain("onResolveSyncConflict");
diff --git a/tests/note-id-copy.test.ts b/tests/note-id-copy.test.ts
index df340b05..a8dc3e48 100644
--- a/tests/note-id-copy.test.ts
+++ b/tests/note-id-copy.test.ts
@@ -27,7 +27,7 @@ describe("copy current note ID", () => {
test("copies the raw memo ID from both native mobile clients", () => {
expect(androidDetailSource).toContain("Clipboard.setStringAsync(memo.id)");
- expect(androidDetailSource).toContain('resolvedLocale !== "zh-CN" ? "Copy note ID" : "复制笔记 ID"');
+ expect(androidDetailSource).toContain("getMobileCatalog(resolvedLocale).editor.copyNoteId");
expect(androidDetailSource).toContain("disabled={!canCopyMemoId}");
expect(iosDetailSource).toContain("UIPasteboard.general.string = memo.id");
expect(iosDetailSource).toContain('env.preferences.t("复制笔记 ID", en: "Copy note ID"');