diff --git a/src/components/Location.vue b/src/components/Location.vue index 6e1ce973..9c31059b 100644 --- a/src/components/Location.vue +++ b/src/components/Location.vue @@ -204,11 +204,11 @@ const accessTypeLabel = translateAccessType(L.accessTypeName); if (L.isOffline) { - text.value = 'Offline'; + text.value = t('location.offline'); } else if (L.isPrivate) { - text.value = 'Private'; + text.value = t('location.private'); } else if (L.isTraveling) { - text.value = 'Traveling'; + text.value = t('location.traveling'); } else if (typeof props.hint === 'string' && props.hint !== '') { if (L.instanceId) { text.value = `${props.hint} · ${accessTypeLabel}`; diff --git a/src/localization/en.json b/src/localization/en.json index ba7ae39c..65daa71a 100644 --- a/src/localization/en.json +++ b/src/localization/en.json @@ -455,7 +455,6 @@ "header": "System Tools", "vrchat_config": "VRChat Config", "vrchat_config_description": "Open VRChat config.json settings", - "launch_options": "Launch Options", "launch_options_description": "Edit VRChat launch options", "registry_backup": "VRChat Registry Backup", "registry_backup_description": "Create or restore a VRChat registry backup" @@ -815,6 +814,14 @@ "header": "Self Invite", "description": "Self invite instead of opening instance in VRChat" }, + "anonymous_error_reporting": { + "header": "Anonymous Error Reporting (Nightly Only)", + "description": "Help improve VRCX by sending anonymous crash and error reports. No personal or VRChat data is collected.", + "consent_title": "Anonymous Error Reporting", + "consent_description": "Allow anonymous error reporting to help improve VRCX?\n\n• Crash and error data only\n• No personal or VRChat data\n• Nightly builds only\n• Can be disabled in Advanced Settings", + "enabled_restart_description": "Error reporting enabled. Restart VRCX to apply changes?", + "disabled_restart_description": "Error reporting disabled. Restart VRCX to apply changes?" + }, "save_instance_prints_to_file": { "header": "Save Instance Prints To File", "header_tooltip": "Requires \"--enable-sdk-log-levels\" VRC launch option", @@ -1869,7 +1876,15 @@ "copy_image": "Copy Image", "open_folder": "Open Folder", "delete_metadata": "Delete Metadata", - "upload": "Upload" + "upload": "Upload", + "search_placeholder": "Search", + "search_type_placeholder": "Search Type", + "search_types": { + "player_name": "Player Name", + "player_id": "Player ID", + "world_name": "World Name", + "world_id": "World ID" + } }, "registry_backup": { "header": "VRC Registry Settings Backup", @@ -2018,6 +2033,11 @@ "status": { "title": "VRChat Status" }, + "location": { + "offline": "Offline", + "private": "Private", + "traveling": "Traveling" + }, "message": { "vrcx_updater": { "failed": "Failed to check for update, {message}", @@ -2475,7 +2495,14 @@ }, "common": { "no_data": "No data", - "no_matching_records": "No matching records" + "no_matching_records": "No matching records", + "time_units": { + "y": "y", + "d": "d", + "h": "h", + "m": "m", + "s": "s" + } }, "vr": { "status": { diff --git a/src/localization/zh-CN.json b/src/localization/zh-CN.json index 861b830c..8c6bb823 100644 --- a/src/localization/zh-CN.json +++ b/src/localization/zh-CN.json @@ -1778,7 +1778,7 @@ "ok": "确定" }, "screenshot_metadata": { - "header": "元数据查看器", + "header": "截图管理", "drag": "拖放图片到这里", "browse": "选择文件", "last_screenshot": "上一张图片", diff --git a/src/shared/utils/base/format.js b/src/shared/utils/base/format.js index 727b067f..c5dedf96 100644 --- a/src/shared/utils/base/format.js +++ b/src/shared/utils/base/format.js @@ -1,5 +1,23 @@ +import { i18n } from '../../../plugin/i18n'; import { escapeTag } from './string'; +const TIME_UNIT_KEYS = { + y: 'common.time_units.y', + d: 'common.time_units.d', + h: 'common.time_units.h', + m: 'common.time_units.m', + s: 'common.time_units.s' +}; + +function getTimeUnitLabel(unit) { + const key = TIME_UNIT_KEYS[unit]; + if (!key) { + return unit; + } + const t = i18n?.global?.t; + return typeof t === 'function' ? t(key) : unit; +} + /** * * @param {number} sec @@ -17,25 +35,25 @@ function timeToText(sec, isNeedSeconds = false) { n = -n; } if (n >= 31536000) { - arr.push(`${Math.floor(n / 31536000)}y`); + arr.push(`${Math.floor(n / 31536000)}${getTimeUnitLabel('y')}`); n %= 31536000; } if (n >= 86400) { - arr.push(`${Math.floor(n / 86400)}d`); + arr.push(`${Math.floor(n / 86400)}${getTimeUnitLabel('d')}`); n %= 86400; } if (n >= 3600) { - arr.push(`${Math.floor(n / 3600)}h`); + arr.push(`${Math.floor(n / 3600)}${getTimeUnitLabel('h')}`); n %= 3600; } if (n >= 60) { - arr.push(`${Math.floor(n / 60)}m`); + arr.push(`${Math.floor(n / 60)}${getTimeUnitLabel('m')}`); n %= 60; } if (isNeedSeconds || (arr.length === 0 && n < 60)) { // round to 5 seconds n = Math.floor((n + 2.5) / 5) * 5; - arr.push(`${n}s`); + arr.push(`${n}${getTimeUnitLabel('s')}`); } return arr.join(' '); } diff --git a/src/stores/settings/advanced.js b/src/stores/settings/advanced.js index 3ee3bd6e..5a0f95f0 100644 --- a/src/stores/settings/advanced.js +++ b/src/stores/settings/advanced.js @@ -471,20 +471,20 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => { async function checkSentryConsent() { modalStore .confirm({ - description: - 'Help improve VRCX by allowing anonymous error reporting?' + - '• Only collects crash and error information.' + - '• No personal data or VRChat information is collected.' + - '• Only enabled in nightly builds.' + - '• Can be disabled at anytime in Advanced Settings.', - title: 'Anonymous Error Reporting' + description: t( + 'view.settings.advanced.advanced.anonymous_error_reporting.consent_description' + ), + title: t( + 'view.settings.advanced.advanced.anonymous_error_reporting.consent_title' + ) }) .then(async ({ ok }) => { if (!ok) return; modalStore .confirm({ - description: - 'Error reporting setting has been enabled. Would you like to restart VRCX now for the change to take effect?', + description: t( + 'view.settings.advanced.advanced.anonymous_error_reporting.enabled_restart_description' + ), title: t('confirm.restart_required_title'), confirmText: t('confirm.restart_now'), cancelText: t('confirm.restart_later') @@ -505,8 +505,9 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => { modalStore .confirm({ - description: - 'Error reporting setting has been disabled. Would you like to restart VRCX now for the change to take effect?', + description: t( + 'view.settings.advanced.advanced.anonymous_error_reporting.disabled_restart_description' + ), title: t('confirm.restart_required_title'), confirmText: t('confirm.restart_now'), cancelText: t('confirm.restart_later') diff --git a/src/views/Charts/components/InstanceActivity.vue b/src/views/Charts/components/InstanceActivity.vue index 458311f5..a635cb94 100644 --- a/src/views/Charts/components/InstanceActivity.vue +++ b/src/views/Charts/components/InstanceActivity.vue @@ -165,9 +165,9 @@ import { HoverCard, HoverCardContent, HoverCardTrigger } from '@/components/ui/hover-card'; import { fromDate, getLocalTimeZone, today } from '@internationalized/date'; import { Button } from '@/components/ui/button'; - import { DataTableEmpty } from '@/components/ui/data-table'; import { ButtonGroup } from '@/components/ui/button-group'; import { Calendar } from '@/components/ui/calendar'; + import { DataTableEmpty } from '@/components/ui/data-table'; import { Separator } from '@/components/ui/separator'; import { storeToRefs } from 'pinia'; import { toDate } from 'reka-ui/date'; diff --git a/src/views/Settings/components/Tabs/AdvancedTab.vue b/src/views/Settings/components/Tabs/AdvancedTab.vue index 7be3a74c..96d527f9 100644 --- a/src/views/Settings/components/Tabs/AdvancedTab.vue +++ b/src/views/Settings/components/Tabs/AdvancedTab.vue @@ -57,9 +57,11 @@ @change="setSelfInviteOverride" />