Skip to content

Commit 3aa24f5

Browse files
authored
feat: 补全遗漏的国际化内容 (#655)
1 parent 5c0de3a commit 3aa24f5

8 files changed

Lines changed: 41 additions & 10 deletions

File tree

src-tauri/capabilities/default.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"core:window:allow-set-decorations",
1616
"core:window:allow-set-position",
1717
"core:window:allow-set-theme",
18+
"core:window:allow-set-title",
1819
"custom-window:default",
1920
"os:default",
2021
"process:default",

src-tauri/tauri.conf.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
},
2626
{
2727
"label": "preference",
28-
"title": "偏好设置",
2928
"url": "index.html/#/preference",
3029
"visible": false,
3130
"titleBarStyle": "Overlay",

src/locales/en-US.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
}
77
},
88
"preference": {
9+
"title": "Preferences",
910
"cat": {
1011
"title": "Cat",
1112
"labels": {
@@ -50,11 +51,16 @@
5051
},
5152
"hints": {
5253
"showTaskbarIcon": "Once enabled, you can capture the window via OBS Studio.",
53-
"inputMonitoringPermission": "Enable input monitoring permission to receive system keyboard and mouse events to respond to your actions."
54+
"inputMonitoringPermission": "Enable input monitoring permission to receive system keyboard and mouse events to respond to your actions.",
55+
"inputMonitoringPermissionGuide": "If the permission is already enabled, first select it and click the \"-\" button to remove it. Then add it again manually and restart the application to ensure the permission takes effect."
5456
},
5557
"status": {
5658
"authorized": "Authorized",
5759
"authorize": "Go to Enable"
60+
},
61+
"buttons": {
62+
"openNow": "Open Now",
63+
"openLater": "Open Later"
5864
}
5965
},
6066
"model": {

src/locales/vi-VN.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
}
77
},
88
"preference": {
9+
"title": "Tùy chỉnh",
910
"cat": {
1011
"title": "Mèo",
1112
"labels": {
@@ -50,11 +51,16 @@
5051
},
5152
"hints": {
5253
"showTaskbarIcon": "Bật để có thể quay cửa sổ qua OBS.",
53-
"inputMonitoringPermission": "Bật quyền giám sát để nhận sự kiện bàn phím và chuột từ hệ thống nhằm phản hồi thao tác của bạn."
54+
"inputMonitoringPermission": "Bật quyền giám sát để nhận sự kiện bàn phím và chuột từ hệ thống nhằm phản hồi thao tác của bạn.",
55+
"inputMonitoringPermissionGuide": "Nếu quyền đã được bật, hãy chọn nó và nhấn nút \"-\" để xóa. Sau đó thêm lại thủ công và khởi động lại ứng dụng để đảm bảo quyền được áp dụng."
5456
},
5557
"status": {
5658
"authorized": "Đã cấp quyền",
5759
"authorize": "Đi đến Bật"
60+
},
61+
"buttons": {
62+
"openNow": "Mở ngay",
63+
"openLater": "Mở sau"
5864
}
5965
},
6066
"model": {

src/locales/zh-CN.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
}
77
},
88
"preference": {
9+
"title": "偏好设置",
910
"cat": {
1011
"title": "猫咪设置",
1112
"labels": {
@@ -50,11 +51,16 @@
5051
},
5152
"hints": {
5253
"showTaskbarIcon": "启用后,即可通过 OBS Studio 捕获窗口。",
53-
"inputMonitoringPermission": "开启输入监控权限,以便接收系统的键盘和鼠标事件来响应你的操作。"
54+
"inputMonitoringPermission": "开启输入监控权限,以便接收系统的键盘和鼠标事件来响应你的操作。",
55+
"inputMonitoringPermissionGuide": "如果权限已开启,请先选中并点击“-”按钮将其删除,然后重新手动添加,最后重启应用以确保权限生效。"
5456
},
5557
"status": {
5658
"authorized": "已授权",
5759
"authorize": "去授权"
60+
},
61+
"buttons": {
62+
"openNow": "前往开启",
63+
"openLater": "稍后开启"
5864
}
5965
},
6066
"model": {

src/pages/preference/components/about/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function feedbackIssue() {
7878
</Button>
7979
</ProListItem>
8080

81-
<ProListItem :title="$t('pages.preference.about.labels.openSourceAddress')">
81+
<ProListItem :title="$t('pages.preference.about.labels.openSource')">
8282
<Button
8383
danger
8484
@click="feedbackIssue"

src/pages/preference/components/general/components/macos-permissions/index.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
<script setup lang="ts">
22
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
3-
import { message } from '@tauri-apps/plugin-dialog'
3+
import { confirm } from '@tauri-apps/plugin-dialog'
44
import { Space } from 'ant-design-vue'
55
import { checkInputMonitoringPermission, requestInputMonitoringPermission } from 'tauri-plugin-macos-permissions-api'
66
import { onMounted, ref } from 'vue'
7+
import { useI18n } from 'vue-i18n'
78
89
import ProList from '@/components/pro-list/index.vue'
910
import ProListItem from '@/components/pro-list-item/index.vue'
1011
import { isMac } from '@/utils/platform'
1112
1213
const authorized = ref(false)
14+
const { t } = useI18n()
1315
1416
onMounted(async () => {
1517
authorized.value = await checkInputMonitoringPermission()
@@ -20,12 +22,15 @@ onMounted(async () => {
2022
2123
await appWindow.setAlwaysOnTop(true)
2224
23-
await message('如果权限已开启,先选中后点击“-”按钮将其删除,再重新手动添加,并重启应用以确保权限生效。', {
24-
title: '输入监控权限',
25-
okLabel: '前往开启',
25+
const confirmed = await confirm(t('pages.preference.general.hints.inputMonitoringPermissionGuide'), {
26+
title: t('pages.preference.general.labels.inputMonitoringPermission'),
27+
okLabel: t('pages.preference.general.buttons.openNow'),
28+
cancelLabel: t('pages.preference.general.buttons.openLater'),
2629
kind: 'warning',
2730
})
2831
32+
if (!confirmed) return
33+
2934
await appWindow.setAlwaysOnTop(false)
3035
3136
requestInputMonitoringPermission()

src/pages/preference/index.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
2+
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
23
import { Flex } from 'ant-design-vue'
3-
import { computed, onMounted, ref } from 'vue'
4+
import { computed, onMounted, ref, watch } from 'vue'
45
import { useI18n } from 'vue-i18n'
56
67
import About from './components/about/index.vue'
@@ -12,17 +13,24 @@ import Shortcut from './components/shortcut/index.vue'
1213
import UpdateApp from '@/components/update-app/index.vue'
1314
import { useTray } from '@/composables/useTray'
1415
import { useAppStore } from '@/stores/app'
16+
import { useGeneralStore } from '@/stores/general'
1517
import { isMac } from '@/utils/platform'
1618
1719
const { createTray } = useTray()
1820
const appStore = useAppStore()
1921
const current = ref(0)
2022
const { t } = useI18n()
23+
const generalStore = useGeneralStore()
24+
const appWindow = getCurrentWebviewWindow()
2125
2226
onMounted(async () => {
2327
createTray()
2428
})
2529
30+
watch(() => generalStore.appearance.language, () => {
31+
appWindow.setTitle(t('pages.preference.title'))
32+
}, { immediate: true })
33+
2634
const menus = computed(() => [
2735
{
2836
label: t('pages.preference.cat.title'),

0 commit comments

Comments
 (0)