Skip to content

Commit

Permalink
optimization: 国际化处理 (closed TencentBlueKing#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
GONGONGONG committed Sep 27, 2022
1 parent 33bc7f8 commit f0f3782
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
4 changes: 4 additions & 0 deletions dev_log/2.2.27/daoqgong_202209271735.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
optimization:
- "国际化处理 (closed #1146)"

4 changes: 2 additions & 2 deletions frontend/src/components/common/nav-side.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<bk-navigation-menu-group
v-if="item.children && item.children.length"
:key="item.title"
:group-name="item.name">
:group-name="$t(item.name)">
<bk-navigation-menu-item
v-for="child in item.children"
:key="child.name"
Expand All @@ -25,7 +25,7 @@
:icon="child.icon"
:has-child="child.children && !!child.children.length"
:default-active="child.active">
<span>{{ child.title }}</span>
<span>{{ $t(child.title) }}</span>
<!-- <div slot="child">
<bk-navigation-menu-item
v-for="set in child.children"
Expand Down
21 changes: 14 additions & 7 deletions frontend/src/components/setup-table/table-header.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<template>
<div :class="['setup-header', { 'is-center': !parentProp }]">
<span
<div
ref="tipSpan"
:class="{
'header-label': true,
'header-label-required': required,
'header-label-tips': Boolean(tips)
}">
{{ $t(label) }}
</span>
<div><span :title="$t(label)">{{ $t(label) }}</span></div>
<!-- <div v-bk-overflow-tips><span>{{ $t(label) }}</span></div> -->
</div>
<bk-popover
v-if="batch"
theme="light batch-edit"
Expand Down Expand Up @@ -230,17 +231,23 @@ export default class TableHeader extends Vue {
@mixin layout-flex row, center;
.header-label {
position: relative;
display: flex;
display: inline-block;
line-height: 16px;
white-space: nowrap;
max-width: 100%;
overflow: hidden;
> div {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
&-required {
margin-right: 6px;
padding-right: 6px;
&::after {
content: "*";
color: #ff5656;
position: absolute;
top: 2px;
right: -7px;
right: 0;
}
}
&-tips {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default {
密码密钥: 'Key/Password',
登录IP提示: 'The IP address of the target server that supports SSH login. If it is a public cloud server, it is usually an external network IP. Please fill in according to actual conditions',
外网IP: 'WAN IP',
外网IPv6: 'WAN IPv6',
内网网卡IP: 'LAN IP',
外网网卡IP: 'Internet IP',
登录IP: 'Login IP',
Expand Down Expand Up @@ -508,6 +509,7 @@ export default {
外网回调地址: 'WAN callback address',
请输入外网回调地址: 'Please enter the WAN callback address',
内网回调地址: 'LAN callback address',
内网回调: 'LAN callback',
请输入内网回调地址: 'Please enter the LAN callback address',
请输入以backend结尾的URL地址: 'Please enter the URL address ending with /backend',

Expand Down Expand Up @@ -572,6 +574,7 @@ export default {
重装AGENT: 'Reinstall Agent',
升级PROXY: 'Upgrading Proxy',
升级Agent: 'Upgrade Agent',
历史: 'History',
任务历史: 'Task History',
已忽略IP无日志详情: 'Ignored IP No Log Details',
正在执行reg: '正在执行',
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/i18n/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default {
密码密钥: '密码/密钥',
登录IP提示: '目标服务器支持SSH登录的IP地址, 如果是公有云服务器,一般为 <b>公网IP</b>,请根据实际情况填写',
外网IP: '外网IP',
外网IPv6: '外网IPv6',
内网网卡IP: '内网网卡IP',
外网网卡IP: '外网网卡IP',
登录IP: '登录IP',
Expand Down Expand Up @@ -497,6 +498,7 @@ export default {
外网回调地址: '外网回调地址',
请输入外网回调地址: '请输入外网回调地址',
内网回调地址: '内网回调地址',
内网回调: '内网回调',
请输入内网回调地址: '请输入内网回调地址',
请输入以backend结尾的URL地址: '请输入以/backend结尾的URL地址',

Expand Down Expand Up @@ -572,6 +574,7 @@ export default {
重装AGENT: '重装 Agent',
升级PROXY: '升级 Proxy',
升级AGENT: '升级 Agent',
历史: '历史',
任务历史: '任务历史',
已忽略IP无日志详情: '已忽略IP无日志详情',
正在执行reg: '正在执行',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/setup/i18n-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let currentLang = cookie.parse(document.cookie).blueking_language
? cookie.parse(document.cookie).blueking_language
: 'zh-cn';

if (['zh-CN', 'zh-cn', 'cn', 'zhCN', 'zhcn'].indexOf(currentLang) > -1) {
if (['zh-CN', 'zh-cn', 'cn', 'zhCN', 'zhcn', 'None', 'none'].indexOf(currentLang) > -1) {
currentLang = 'zhCN';
window.language = 'zh';
} else {
Expand Down

0 comments on commit f0f3782

Please sign in to comment.