From 73735e1a1ddcc69f9881fdefa6828f4e3c6baef0 Mon Sep 17 00:00:00 2001 From: a20070322 <1031839775@qq.com> Date: Thu, 9 May 2024 15:24:14 +0800 Subject: [PATCH] i18n: pages/layout and fix i18n bug --- .../locales/en_US/pages/docker/container.ts | 58 +-------- .../i18n/locales/en_US/pages/layout/index.ts | 24 ++-- .../locales/en_US/pages/layout/overview.ts | 33 +---- .../locales/en_US/pages/layout/user-header.ts | 117 ++++++++++++++++++ .../i18n/locales/en_US/pages/monitor/index.ts | 6 +- .../locales/zh-CN/pages/docker/container.ts | 2 +- .../i18n/locales/zh-CN/pages/layout/index.ts | 24 ++-- .../locales/zh-CN/pages/layout/overview.ts | 2 +- web-vue/src/pages/docker/container.vue | 2 +- web-vue/src/pages/docker/prune.vue | 2 +- web-vue/src/pages/layout/overview.vue | 4 +- web-vue/src/pages/layout/user-header.vue | 4 +- 12 files changed, 159 insertions(+), 119 deletions(-) create mode 100644 web-vue/src/i18n/locales/en_US/pages/layout/user-header.ts diff --git a/web-vue/src/i18n/locales/en_US/pages/docker/container.ts b/web-vue/src/i18n/locales/en_US/pages/docker/container.ts index 68741b18d..5c43d2453 100644 --- a/web-vue/src/i18n/locales/en_US/pages/docker/container.ts +++ b/web-vue/src/i18n/locales/en_US/pages/docker/container.ts @@ -18,7 +18,7 @@ export default { nameLabel: 'Name:', readWrite: 'Read/Write', read: 'Read', - path: 'Path: {{ item.source }}(Host) => {{ item.destination }}(Container)', + path: 'Path: {source}(Host) => {destination}(Container)', networkPort: 'Network Port', bridgeMode: 'Bridge Mode:', gateway: 'Gateway', @@ -33,41 +33,7 @@ export default { edit: 'Edit', logs: 'Logs', forceDelete: 'Force delete', - delete: 'Delete', - name_1: 'Name', - containerId_1: 'Container ID', - imageId_1: 'Image ID', - view_1: 'View', - all_1: 'All', - running_1: 'Running', - search_1: 'Search', - seconds_1: 's seconds', - refreshCountdown_1: 'Refresh countdown', - containerName_1: 'Container Name:', - containerIdLabel_1: 'Container ID:', - image_1: 'Image:', - imageIdLabel_1: 'Image ID:', - containerNameTag_1: 'Container Name Tag', - mount_1: 'Mount', - nameLabel_1: 'Name:', - readWrite_1: 'Read/Write', - read_1: 'Read', - path_1: 'Path: {{ item.source }} (Host) => {{ item.destination }} (Container)', - networkPort_1: 'Network Port', - bridgeMode_1: 'Bridge Mode:', - gateway_1: 'Gateway', - viewLogs_1: 'Click to view logs', - enterTerminal_1: 'Enter terminal when container is running', - stop_1: 'Stop', - restart_1: 'Restart', - start_1: 'Start', - modifyAndRun_1: 'Modify container configuration and run again', - rebuild_1: 'Rebuild', - editBasicParams_1: 'Edit some basic parameters of the container', - edit_1: 'Edit', - logs_1: 'Logs', - forceDelete_1: 'Force delete', - delete_1: 'Delete' + delete: 'Delete' }, p: { noData: 'No data available', @@ -87,24 +53,6 @@ export default { confirmStart: 'Are you sure you want to start the current container?', systemPrompt: 'System Prompt', confirm: 'Confirm', - cancel: 'Cancel', - noData_1: 'No data available', - configureContainer_1: 'Configure Container', - serialNumber_1: 'Serial Number', - containerId_1: 'Container ID', - imageId_1: 'Image ID', - status_1: 'Status', - port_1: 'Port', - tag_1: 'Tag', - command_1: 'Command', - createTime_1: 'Creation Time', - operation_1: 'Operation', - confirmDelete_1: 'Are you sure you want to delete the current container?', - confirmStop_1: 'Are you sure you want to stop the current container?', - confirmRestart_1: 'Are you sure you want to restart the current container?', - confirmStart_1: 'Are you sure you want to start the current container?', - systemPrompt_1: 'System Prompt', - confirm_1: 'Confirm', - cancel_1: 'Cancel' + cancel: 'Cancel' } } diff --git a/web-vue/src/i18n/locales/en_US/pages/layout/index.ts b/web-vue/src/i18n/locales/en_US/pages/layout/index.ts index 8fc56e3bf..51027fb30 100644 --- a/web-vue/src/i18n/locales/en_US/pages/layout/index.ts +++ b/web-vue/src/i18n/locales/en_US/pages/layout/index.ts @@ -1,14 +1,15 @@ -import about from './about.ts' -import contentTab from './content-tab.ts' -import defaultBg from './default-bg.ts' -import defaultIndex from './default-index.ts' -import ipAccess from './ipAccess.ts' -import loading from './loading.ts' -import management from './management.ts' -import myWorkspace from './my-workspace.ts' -import overview from './overview.ts' -import sideMenu from './side-menu.ts' -import userLog from './user-log.ts' +import about from './about' +import contentTab from './content-tab' +import defaultBg from './default-bg' +import defaultIndex from './default-index' +import ipAccess from './ipAccess' +import loading from './loading' +import management from './management' +import myWorkspace from './my-workspace' +import overview from './overview' +import sideMenu from './side-menu' +import userHeader from './user-header' +import userLog from './user-log' export default { about, @@ -21,5 +22,6 @@ export default { myWorkspace, overview, sideMenu, + userHeader, userLog } diff --git a/web-vue/src/i18n/locales/en_US/pages/layout/overview.ts b/web-vue/src/i18n/locales/en_US/pages/layout/overview.ts index 72bd42258..366d365d8 100644 --- a/web-vue/src/i18n/locales/en_US/pages/layout/overview.ts +++ b/web-vue/src/i18n/locales/en_US/pages/layout/overview.ts @@ -8,7 +8,7 @@ export default { p: { welcome: 'Welcome [', systemUsage: '] You are using this system', - manageWorkspaces: 'You can manage {{ (myWorkspaceList && myWorkspaceList.length) || 0 }} workspaces', + manageWorkspaces: 'You can manage {count} workspaces', demoAccount: 'Demo account', superuser: 'Super administrator', admin: 'Administrator', @@ -34,35 +34,6 @@ export default { localScript: 'Local script', node: 'Node', cluster: 'Cluster', - dynamicFile: 'Dynamic file', - welcome_1: 'Welcome [', - systemUsage_1: '] You are using this system', - manageWorkspaces_1: 'You can manage {{ (myWorkspaceList && myWorkspaceList.length) || 0 }} workspaces', - demoAccount_1: 'Demo Account', - superuser_1: 'Superuser', - admin_1: 'Admin', - normalUser_1: 'Normal User', - refreshData_1: 'Refresh Data', - systemInfo_1: 'System Info', - dataStatistics_1: 'Data Statistics', - relatedDataStatistics_1: 'Related Data Statistics for the Current Workspace', - buildLog_1: 'Build Log', - triggeredBuilds_1: 'Build Records Triggered by You in the Current Workspace', - notYetBuilt_1: 'You Have Not Built Yet', - loginLog_1: 'Login Log', - notYetLoggedIn_1: 'You Have Not Logged In Yet', - allOperationLog_1: 'All Your Operation Logs in the System', - notYetPerformedOperations_1: 'You Have Not Performed Any Operations Yet', - openSourceInfo_1: 'Open Source Information', - logicNode_1: 'Logic Node', - nodeProject_1: 'Node Project', - nodeScript_1: 'Node Script', - projectDistribution_1: 'Project Distribution', - terminal_1: 'Terminal', - script_1: 'Script', - localScript_1: 'Local Script', - node_1: 'Node', - cluster_1: 'Cluster', - dynamicFile_1: 'Dynamic File' + dynamicFile: 'Dynamic file' } } diff --git a/web-vue/src/i18n/locales/en_US/pages/layout/user-header.ts b/web-vue/src/i18n/locales/en_US/pages/layout/user-header.ts new file mode 100644 index 000000000..bf8eebfba --- /dev/null +++ b/web-vue/src/i18n/locales/en_US/pages/layout/user-header.ts @@ -0,0 +1,117 @@ +export default { + c: { + unConfigured: 'Unconfigured', + bracketRight: '】', + bracketLeft: '【', + securityManagement: 'Security Management', + operationLog: 'Operation Log', + oldPassword: 'Please enter your current password', + newPassword: 'Please enter your new password', + confirmPassword: 'Please confirm your new password', + verificationCode: 'Verification Code', + twoStepVerificationCode: 'Two-Step Verification Code', + twoStepVerificationApp: 'Two-Step Verification App', + nickname: 'Nickname', + emailAddress: 'Email Address', + emailVerificationCode: 'Email Verification Code', + dingNotificationAddress: 'DingTalk Notification Address', + enterpriseWeChatNotificationAddress: 'Enterprise WeChat Notification Address', + lightTheme: 'Light Theme', + darkTheme: 'Dark Theme', + securityReminder: 'Security Reminder', + nicknameLength: 'Nickname should be 2-10 characters long', + passwordLength: 'Password should be 6-20 characters long', + systemPrompt: 'System Prompt', + confirm: 'Confirm', + cancel: 'Cancel', + logoutSuccess: 'Logout successful' + }, + p: { + workspaceName: 'Workspace Name:', + groupName: 'Group Name:', + clusterName: 'Cluster Name:', + switchWorkspace: 'Switch Workspace', + switchCluster: 'Switch Cluster', + userProfile: 'User Profile', + personalConfiguration: 'Personal Configuration', + logout: 'Logout', + switchAccount: 'Switch Account', + completeLogout: 'Complete Logout', + changePassword: 'Change Password', + originalPassword: 'Original Password', + newPassword: 'New Password', + confirmPassword: 'Confirm Password', + confirmReset: 'Confirm Reset', + twoStepVerification: 'Two-Step Verification', + prompt: 'Prompt', + mfaKey: + 'This will not be displayed after binding. It is strongly recommended to save this QR code or the MFA key below.', + pleaseScanQRCodeAndBindToken: + 'Please use the app to scan the QR code to bind the token, then enter the verification code to confirm the binding.', + currentStatus: 'Current Status', + opening: 'Opening', + closing: 'Closing', + qrCode: 'QR Code', + confirmBind: 'Confirm Bind', + confirmClose: 'Confirm Close', + enableMFA: 'Enable MFA', + editUserProfile: 'Edit User Profile', + temporaryToken: 'Temporary Token', + permanentToken: 'Permanent Token', + sendVerificationCode: 'Send Verification Code', + personalConfigArea: 'Personal Configuration Area', + theseConfigsOnlyEffectiveInCurrentBrowser: + 'These configuration settings will only be effective in the current browser.', + clearingBrowserCacheWillRestoreDefaults: 'Clearing the browser cache will restore default settings.', + menuConfig: 'Menu Configuration', + yes: 'Yes', + no: 'No', + expandMultipleAtOnce: 'Expand Multiple at Once', + fullScreenLog: 'Full Screen Log', + fullScreen: 'Full Screen', + notFullScreen: 'Not Full Screen', + viewLogInFullScreen: 'View Log in Full Screen', + contentTheme: 'Content Theme', + followSystem: 'Follow System', + contentAreaThemeSwitch: 'Content Area Theme Switch', + menuTheme: 'Menu Theme', + leftMenuThemeSwitch: 'Left Menu Theme Switch', + compactMode: 'Compact Mode', + compact: 'Compact', + loose: 'Loose', + fontSpacingAdjustment: 'Font Spacing Adjustment', + onlyEffectiveInDarkMode: 'Only Effective in Dark Mode', + language: 'Language', + chinese: 'Chinese', + forYourAccountSecurityTheSystemRequiresTwoStepVerificationToBeEnabledToEnsureAccountSafety: + 'For the security of your account, the system requires two-step verification to be enabled to ensure account safety.', + enableImmediately: 'Enable immediately', + nickname: 'Please enter a nickname', + twoStepVerificationCode: 'Please enter the two-step verification code', + verificationCode6: 'Verification code 6 is pure digits', + closeOperationGuide: 'Close the page operation guide and navigation', + openOperationGuide: 'Enable the page operation guide and navigation', + multipleMenusExpand: 'Multiple menus can be expanded at the same time', + singleMenuExpand: 'Only one menu can be expanded at a time', + autoExpandContent: 'The page content automatically expands to appear on the screen scrollbar', + fullScreen_1: 'Full screen for the page, height 100%. Partial areas can be scrolled', + scrollableContent: 'The page content will have a scrollbar', + hiddenScrollbar: + 'Hide the scrollbar. Vertical scrolling reminder: scroll wheel, horizontal scrolling: Shift + scroll wheel', + logDialogFullScreen: 'The log dialog will open in full screen', + logDialogNonFullScreen: 'The log dialog will open in non-full screen', + compactMode_1: 'Enable compact mode for the page', + looseMode: 'Enable loose mode for the page', + resetOperationGuideSuccess: 'Reset the page operation guide and navigation successfully', + quitConfirmation: + 'Are you sure you want to completely exit the system? Completely exiting will log you out and clear the browser cache', + switchAccountConfirmation: 'Are you sure you want to exit and switch to another account to log in?', + quitSystemConfirmation: 'Are you sure you want to exit the system?', + passwordsNotMatch: 'The two passwords do not match...', + emailAddress: 'Please enter an email address', + clusterNotConfigured: 'The cluster address has not been configured yet, and the cluster cannot be switched', + verificationCodeRequired: 'A verification code is required. It will take effect after confirmation of binding', + disableTwoStepVerificationConfirmation: + 'Are you sure you want to disable two-step verification? Disabling it will affect the security of your account, and existing mfa keys will be invalidated' + } +} diff --git a/web-vue/src/i18n/locales/en_US/pages/monitor/index.ts b/web-vue/src/i18n/locales/en_US/pages/monitor/index.ts index 2f7dd0e8f..5a62dd807 100644 --- a/web-vue/src/i18n/locales/en_US/pages/monitor/index.ts +++ b/web-vue/src/i18n/locales/en_US/pages/monitor/index.ts @@ -1,6 +1,6 @@ -import list from './list.ts' -import log from './log.ts' -import operateLog from './operate-log.ts' +import list from './list' +import log from './log' +import operateLog from './operate-log' export default { list, diff --git a/web-vue/src/i18n/locales/zh-CN/pages/docker/container.ts b/web-vue/src/i18n/locales/zh-CN/pages/docker/container.ts index 9cd0a9ba2..3faefa715 100644 --- a/web-vue/src/i18n/locales/zh-CN/pages/docker/container.ts +++ b/web-vue/src/i18n/locales/zh-CN/pages/docker/container.ts @@ -18,7 +18,7 @@ export default { nameLabel: '名称:', readWrite: '读写', read: '读', - path: '路径:{{ item.source }}(宿主机) => {{ item.destination }}(容器)', + path: '路径:{source}(宿主机) => {destination}(容器)', networkPort: '网络端口', bridgeMode: '桥接模式:', gateway: '网关', diff --git a/web-vue/src/i18n/locales/zh-CN/pages/layout/index.ts b/web-vue/src/i18n/locales/zh-CN/pages/layout/index.ts index bb4408fcd..51027fb30 100644 --- a/web-vue/src/i18n/locales/zh-CN/pages/layout/index.ts +++ b/web-vue/src/i18n/locales/zh-CN/pages/layout/index.ts @@ -1,15 +1,15 @@ -import about from './about.ts' -import contentTab from './content-tab.ts' -import defaultBg from './default-bg.ts' -import defaultIndex from './default-index.ts' -import ipAccess from './ipAccess.ts' -import loading from './loading.ts' -import management from './management.ts' -import myWorkspace from './my-workspace.ts' -import overview from './overview.ts' -import sideMenu from './side-menu.ts' -import userHeader from './user-header.ts' -import userLog from './user-log.ts' +import about from './about' +import contentTab from './content-tab' +import defaultBg from './default-bg' +import defaultIndex from './default-index' +import ipAccess from './ipAccess' +import loading from './loading' +import management from './management' +import myWorkspace from './my-workspace' +import overview from './overview' +import sideMenu from './side-menu' +import userHeader from './user-header' +import userLog from './user-log' export default { about, diff --git a/web-vue/src/i18n/locales/zh-CN/pages/layout/overview.ts b/web-vue/src/i18n/locales/zh-CN/pages/layout/overview.ts index 05fbd9192..a7053501d 100644 --- a/web-vue/src/i18n/locales/zh-CN/pages/layout/overview.ts +++ b/web-vue/src/i18n/locales/zh-CN/pages/layout/overview.ts @@ -6,7 +6,7 @@ export default { p: { welcome: '欢迎【', systemUsage: '】您使用本系统', - manageWorkspaces: '可以管理{{ (myWorkspaceList && myWorkspaceList.length) || 0 }}个工作空间', + manageWorkspaces: '可以管理{count}个工作空间', demoAccount: '演示账号', superuser: '超级管理员', admin: '管理员', diff --git a/web-vue/src/pages/docker/container.vue b/web-vue/src/pages/docker/container.vue index c14d7ac2f..14f85cd8e 100644 --- a/web-vue/src/pages/docker/container.vue +++ b/web-vue/src/pages/docker/container.vue @@ -403,7 +403,7 @@ {{ $tl('c.nameLabel') }}{{ item.name }} {{ item.rw ? $tl('c.readWrite') : $tl('c.read') }}

-

{{ $tl('c.path') }}

+

{{ $tl('c.path', { source: item.source, destination: item.destination }) }}

diff --git a/web-vue/src/pages/docker/prune.vue b/web-vue/src/pages/docker/prune.vue index be87cf74b..6f3a368d3 100644 --- a/web-vue/src/pages/docker/prune.vue +++ b/web-vue/src/pages/docker/prune.vue @@ -21,7 +21,7 @@ - +