Skip to content

Commit

Permalink
🌐 appMenu翻译
Browse files Browse the repository at this point in the history
  • Loading branch information
Littlefean committed Nov 13, 2024
1 parent ff7b3f8 commit 3ee3ccc
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 28 deletions.
35 changes: 35 additions & 0 deletions src/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,38 @@ settingsControl:
gamepadDeadzone: Gamepad Deadzone
app:
unsaved: '*'
appMenu:
file:
title: File
items:
new: New
open: Open
save: Save
saveAs: Save As
recent: Recent Files
location:
title: Location
items:
openDataFolder: Open Data Folder
openProjectFolder: Open Project Folder
export:
title: Export
items:
exportAsSVGByAll: Export as SVG (All)
exportAsMarkdownBySelected: Export as Markdown (Selected)
view:
title: View
items:
resetByAll: Reset View by All Content
resetBySelect: Reset View by Selected Content
more:
title: More
items:
settings: Settings
about: About
welcome: Welcome Screen
window:
title: Window
items:
refresh: Refresh
fullscreen: Full Screen
43 changes: 39 additions & 4 deletions src/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ settingsVisual:
vertical: 垂直折线
showGrid: 显示网格
windowBackgroundAlpha: 窗口不透明度
showDebug:
showDebug:
title: 显示调试信息
description: "通常为开发者使用\n开启后,画布左上角将会显示调试信息。\n若您遇到bug截图反馈时,建议开启此选项。"
alwaysShowDetails:
alwaysShowDetails:
title: 始终显示节点详细信息
description: "开启后,无需鼠标移动到节点上时,才显示节点的详细信息。"
useNativeTitleBar:
useNativeTitleBar:
title: 使用原生标题栏(需要重启应用)
description: "开启后,窗口顶部将会出现原生的标题栏,而不是模拟的标题栏。"
protectingPrivacy:
Expand All @@ -74,4 +74,39 @@ settingsControl:
description: "此设置项用于 使用W S A D按键来上下左右移动视角时的情景\n摩擦系数越大,滑动的距离越小,摩擦系数越小,滑动的距离越远\n此值=0时代表 绝对光滑"
gamepadDeadzone: 游戏手柄死区
app:
unsaved: '*'
unsaved: "*"
appMenu:
file:
title: 文件
items:
new: 新建
open: 打开
save: 保存
saveAs: 另存为
recent: 最近打开
location:
title: 位置
items:
openDataFolder: 打开数据文件夹
openProjectFolder: 打开工程文件夹
export:
title: 导出
items:
exportAsSVGByAll: 导出为SVG(全部)
exportAsMarkdownBySelected: 导出为Markdown(选中)
view:
title: 视图
items:
resetByAll: 根据全部内容重置视野
resetBySelect: 根据选中内容重置视野
more:
title: 更多
items:
settings: 设置
about: 关于
welcome: 欢迎界面
window:
title: 窗口
items:
refresh: 刷新
fullscreen: 全屏
35 changes: 35 additions & 0 deletions src/locales/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,38 @@ settingsControl:

app:
unsaved: '*'
appMenu:
file:
title: 檔案
items:
new: 新建
open: 打開
save: 保存
saveAs: 另存為
recent: 最近打開
location:
title: 位置
items:
openDataFolder: 打開數據資料夾
openProjectFolder: 打開工程資料夾
export:
title: 匯出
items:
exportAsSVGByAll: 匯出為SVG(全部)
exportAsMarkdownBySelected: 匯出為Markdown(選中)
view:
title: 視圖
items:
resetByAll: 根據全部內容重置視野
resetBySelect: 根據選中內容重置視野
more:
title: 更多
items:
settings: 設定
about: 關於
welcome: 歡迎畫面
window:
title: 窗口
items:
refresh: 刷新
fullscreen: 全螢幕
48 changes: 24 additions & 24 deletions src/pages/_app_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { getCurrentWindow } from "@tauri-apps/api/window";
import { StageSaveManager } from "../core/stage/StageSaveManager";
import { StageDumperSvg } from "../core/stage/StageDumperSvg";
import { TextNode } from "../core/stageObject/entity/TextNode";

import { useTranslation } from "react-i18next";

export default function AppMenu({
className = "",
Expand All @@ -53,7 +53,7 @@ export default function AppMenu({
const navigate = useNavigate();
const dialog = useDialog();
const [file, setFile] = useRecoilState(fileAtom);

const { t } = useTranslation("appMenu");
const [, setRecentFilePanelOpen] = useRecoilState(isRecentFilePanelOpenAtom);

const onNew = () => {
Expand Down Expand Up @@ -293,24 +293,24 @@ export default function AppMenu({
)}
onPointerDown={(e) => e.stopPropagation()}
>
<Row icon={<File />} title="文件">
<Row icon={<File />} title={t("file.title")}>
<Col icon={<FilePlus />} onClick={onNew}>
新建
{t("file.items.new")}
</Col>
<Col icon={<FileText />} onClick={onOpen}>
打开
{t("file.items.open")}
</Col>
<Col icon={<FileText />} onClick={() => setRecentFilePanelOpen(true)}>
最近
{t("file.items.recent")}
</Col>
<Col icon={<Save />} onClick={onSave}>
保存
{t("file.items.save")}
</Col>
<Col icon={<Save />} onClick={onSaveNew}>
另存为
{t("file.items.saveAs")}
</Col>
</Row>
<Row icon={<Folder />} title="位置">
<Row icon={<Folder />} title={t("location.title")}>
<Col
icon={<FolderCog />}
onClick={() => {
Expand All @@ -322,7 +322,7 @@ export default function AppMenu({
});
}}
>
打开软件数据文件夹
{t("location.items.openDataFolder")}
</Col>
<Col
icon={<FolderOpen />}
Expand All @@ -335,37 +335,37 @@ export default function AppMenu({
});
}}
>
打开此文档所在文件夹
{t("location.items.openProjectFolder")}
</Col>
</Row>
<Row icon={<File />} title="导出">
<Row icon={<File />} title={t("export.title")}>
<Col icon={<FileCode />} onClick={onSaveSVGNew}>
全部舞台导出SVG
{t("export.items.exportAsSVGByAll")}
</Col>
<Col icon={<FileType />} onClick={onSaveMarkdownNew}>
选中的根节点导出markdown
{t("export.items.exportAsMarkdownBySelected")}
</Col>
</Row>
<Row icon={<View />} title="视图">
<Row icon={<View />} title={t("view.title")}>
<Col icon={<SquareDashedKanbanIcon />} onClick={() => Camera.reset()}>
根据全部节点重置视野
{t("view.items.resetByAll")}
</Col>
<Col
icon={<SquareDashedMousePointer />}
onClick={() => Camera.resetBySelected()}
>
根据选中节点重置视野
{t("view.items.resetBySelect")}
</Col>
</Row>
<Row icon={<MoreHorizontal />} title="更多">
<Row icon={<MoreHorizontal />} title={t("more.title")}>
<Col
icon={<SettingsIcon />}
onClick={() => navigate("/settings/visual")}
>
设置
{t("more.items.settings")}
</Col>
<Col icon={<Info />} onClick={() => navigate("/settings/about")}>
关于
{t("more.items.about")}
</Col>

<Col
Expand All @@ -374,12 +374,12 @@ export default function AppMenu({
navigate("/welcome");
}}
>
welcome
{t("more.items.welcome")}
</Col>
</Row>
<Row icon={<AppWindow />} title="窗口">
<Row icon={<AppWindow />} title={t("window.title")}>
<Col icon={<RefreshCcw />} onClick={() => window.location.reload()}>
刷新
{t("window.items.refresh")}
</Col>
<Col
icon={<Fullscreen />}
Expand All @@ -389,7 +389,7 @@ export default function AppMenu({
.then((res) => getCurrentWindow().setFullscreen(!res))
}
>
全屏
{t("window.items.fullscreen")}
</Col>
</Row>
<Row icon={<Dock />} title="测试">
Expand Down

0 comments on commit 3ee3ccc

Please sign in to comment.