feat: 补全遗漏的国际化内容 (#655)

This commit is contained in:
ayangweb
2025-09-22 21:08:51 +08:00
committed by GitHub
parent 5c0de3afb6
commit 3aa24f5b75
8 changed files with 41 additions and 10 deletions

View File

@@ -15,6 +15,7 @@
"core:window:allow-set-decorations",
"core:window:allow-set-position",
"core:window:allow-set-theme",
"core:window:allow-set-title",
"custom-window:default",
"os:default",
"process:default",

View File

@@ -25,7 +25,6 @@
},
{
"label": "preference",
"title": "偏好设置",
"url": "index.html/#/preference",
"visible": false,
"titleBarStyle": "Overlay",

View File

@@ -6,6 +6,7 @@
}
},
"preference": {
"title": "Preferences",
"cat": {
"title": "Cat",
"labels": {
@@ -50,11 +51,16 @@
},
"hints": {
"showTaskbarIcon": "Once enabled, you can capture the window via OBS Studio.",
"inputMonitoringPermission": "Enable input monitoring permission to receive system keyboard and mouse events to respond to your actions."
"inputMonitoringPermission": "Enable input monitoring permission to receive system keyboard and mouse events to respond to your actions.",
"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."
},
"status": {
"authorized": "Authorized",
"authorize": "Go to Enable"
},
"buttons": {
"openNow": "Open Now",
"openLater": "Open Later"
}
},
"model": {

View File

@@ -6,6 +6,7 @@
}
},
"preference": {
"title": "Tùy chỉnh",
"cat": {
"title": "Mèo",
"labels": {
@@ -50,11 +51,16 @@
},
"hints": {
"showTaskbarIcon": "Bật để có thể quay cửa sổ qua OBS.",
"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."
"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.",
"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."
},
"status": {
"authorized": "Đã cấp quyền",
"authorize": "Đi đến Bật"
},
"buttons": {
"openNow": "Mở ngay",
"openLater": "Mở sau"
}
},
"model": {

View File

@@ -6,6 +6,7 @@
}
},
"preference": {
"title": "偏好设置",
"cat": {
"title": "猫咪设置",
"labels": {
@@ -50,11 +51,16 @@
},
"hints": {
"showTaskbarIcon": "启用后,即可通过 OBS Studio 捕获窗口。",
"inputMonitoringPermission": "开启输入监控权限,以便接收系统的键盘和鼠标事件来响应你的操作。"
"inputMonitoringPermission": "开启输入监控权限,以便接收系统的键盘和鼠标事件来响应你的操作。",
"inputMonitoringPermissionGuide": "如果权限已开启,请先选中并点击“-”按钮将其删除,然后重新手动添加,最后重启应用以确保权限生效。"
},
"status": {
"authorized": "已授权",
"authorize": "去授权"
},
"buttons": {
"openNow": "前往开启",
"openLater": "稍后开启"
}
},
"model": {

View File

@@ -78,7 +78,7 @@ function feedbackIssue() {
</Button>
</ProListItem>
<ProListItem :title="$t('pages.preference.about.labels.openSourceAddress')">
<ProListItem :title="$t('pages.preference.about.labels.openSource')">
<Button
danger
@click="feedbackIssue"

View File

@@ -1,15 +1,17 @@
<script setup lang="ts">
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
import { message } from '@tauri-apps/plugin-dialog'
import { confirm } from '@tauri-apps/plugin-dialog'
import { Space } from 'ant-design-vue'
import { checkInputMonitoringPermission, requestInputMonitoringPermission } from 'tauri-plugin-macos-permissions-api'
import { onMounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ProList from '@/components/pro-list/index.vue'
import ProListItem from '@/components/pro-list-item/index.vue'
import { isMac } from '@/utils/platform'
const authorized = ref(false)
const { t } = useI18n()
onMounted(async () => {
authorized.value = await checkInputMonitoringPermission()
@@ -20,12 +22,15 @@ onMounted(async () => {
await appWindow.setAlwaysOnTop(true)
await message('如果权限已开启,先选中后点击“-”按钮将其删除,再重新手动添加,并重启应用以确保权限生效。', {
title: '输入监控权限',
okLabel: '前往开启',
const confirmed = await confirm(t('pages.preference.general.hints.inputMonitoringPermissionGuide'), {
title: t('pages.preference.general.labels.inputMonitoringPermission'),
okLabel: t('pages.preference.general.buttons.openNow'),
cancelLabel: t('pages.preference.general.buttons.openLater'),
kind: 'warning',
})
if (!confirmed) return
await appWindow.setAlwaysOnTop(false)
requestInputMonitoringPermission()

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
import { Flex } from 'ant-design-vue'
import { computed, onMounted, ref } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import About from './components/about/index.vue'
@@ -12,17 +13,24 @@ import Shortcut from './components/shortcut/index.vue'
import UpdateApp from '@/components/update-app/index.vue'
import { useTray } from '@/composables/useTray'
import { useAppStore } from '@/stores/app'
import { useGeneralStore } from '@/stores/general'
import { isMac } from '@/utils/platform'
const { createTray } = useTray()
const appStore = useAppStore()
const current = ref(0)
const { t } = useI18n()
const generalStore = useGeneralStore()
const appWindow = getCurrentWebviewWindow()
onMounted(async () => {
createTray()
})
watch(() => generalStore.appearance.language, () => {
appWindow.setTitle(t('pages.preference.title'))
}, { immediate: true })
const menus = computed(() => [
{
label: t('pages.preference.cat.title'),