From 7e1618cfc204b5148bc6eee4338eafcdb0ecaa79 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Fri, 17 Jan 2025 09:48:15 +0800 Subject: [PATCH] feat: add i18n for customize toolbar (#2592) --- .../src/modules/customize-toolbar/modal.tsx | 13 ++++++++----- locales/settings/en.json | 5 +++++ locales/settings/zh-CN.json | 5 +++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/apps/renderer/src/modules/customize-toolbar/modal.tsx b/apps/renderer/src/modules/customize-toolbar/modal.tsx index 06aae22b4..0dcd68b0e 100644 --- a/apps/renderer/src/modules/customize-toolbar/modal.tsx +++ b/apps/renderer/src/modules/customize-toolbar/modal.tsx @@ -24,6 +24,7 @@ import { DEFAULT_ACTION_ORDER } from "./constant" import { DroppableContainer, SortableActionButton } from "./dnd" const CustomizeToolbar = () => { + const { t } = useTranslation("settings") const actionOrder = useUISettingSelector((s) => s.toolbarOrder) const sensors = useSensors( @@ -79,8 +80,8 @@ const CustomizeToolbar = () => { return (
-

Quick Actions

-

Customize and reorder your frequently used actions

+

{t("customizeToolbar.quick_actions.title")}

+

{t("customizeToolbar.quick_actions.description")}

{/* Refer to https://github.com/clauderic/dnd-kit/blob/master/stories/2%20-%20Presets/Sortable/MultipleContainers.tsx */} @@ -100,8 +101,10 @@ const CustomizeToolbar = () => { {/* More panel */}
-

More Actions

-

Will be shown in the dropdown menu

+

{t("customizeToolbar.more_actions.title")}

+

+ {t("customizeToolbar.more_actions.description")} +

@@ -119,7 +122,7 @@ const CustomizeToolbar = () => {
diff --git a/locales/settings/en.json b/locales/settings/en.json index 5075d76ef..1c3d65e55 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -97,6 +97,11 @@ "appearance.zen_mode.description": "Zen mode is an undisturbed reading mode that allows you to focus on the content without any interference. Enabling Zen mode will hide the sidebar.", "appearance.zen_mode.label": "Zen mode", "common.give_star": "Love our product? Give us a star on GitHub!", + "customizeToolbar.more_actions.description": "Will be shown in the dropdown menu", + "customizeToolbar.more_actions.title": "More Actions", + "customizeToolbar.quick_actions.description": "Customize and reorder your frequently used actions", + "customizeToolbar.quick_actions.title": "Quick Actions", + "customizeToolbar.reset_layout": "Reset to Default Layout", "customizeToolbar.title": "Customize Toolbar", "data_control.app_cache_limit.description": "The maximum size of the app cache. Once the cache reaches this size, the oldest items will be deleted to free up space.", "data_control.app_cache_limit.label": "App Cache Limit", diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index 880a4d659..25f0f6559 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -97,6 +97,11 @@ "appearance.zen_mode.description": "禅定模式是一种不受干扰的阅读模式,让你能够专注于内容而不受任何干扰。启用禅定模式将会隐藏侧边栏。", "appearance.zen_mode.label": "禅定模式", "common.give_star": "喜欢我们的产品吗? 在 GitHub 上给我们「标星」吧!", + "customizeToolbar.more_actions.description": "将显示在下拉菜单中", + "customizeToolbar.more_actions.title": "更多操作", + "customizeToolbar.quick_actions.description": "自定义并重新排列您常用的操作", + "customizeToolbar.quick_actions.title": "快捷操作", + "customizeToolbar.reset_layout": "重置为默认布局", "customizeToolbar.title": "自定义工具栏", "data_control.app_cache_limit.description": "应用缓存大小的上限。一旦缓存达到此上限,最早的项目将被删除以释放空间。", "data_control.app_cache_limit.label": "应用缓存限制",