Skip to content

Commit

Permalink
fix: 添加国际化及样式修改 (#6555)
Browse files Browse the repository at this point in the history
  • Loading branch information
john1298308460 authored and wanghe-fit2cloud committed Sep 23, 2024
1 parent 9be9f19 commit 236a2df
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 22 deletions.
5 changes: 4 additions & 1 deletion frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,9 @@ const message = {
composeHelper:
'The composition created through 1Panel editor or template will be saved in the {0}/docker/compose directory.',
deleteFile: 'Delete file',
allDelete: 'Permanently Delete',
deleteComposeHelper:
'Delete all files in the {0} directory, including persistent files in this directory. Please proceed with caution!',
'1. Delete container orchestration records \n2. Delete all container orchestration files, including configuration and persistent files',
deleteCompose: '" Delete this composition.',
apps: 'Apps',
local: 'Local',
Expand All @@ -784,6 +785,8 @@ const message = {
contentEmpty: 'Compose content cannot be empty, please enter and try again!',
containerNumber: 'Container number',
containerStatus: 'Container Status',
exited: 'Exited',
running: 'Running',
down: 'Down',
up: 'Up',
composeDetailHelper:
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,8 @@ const message = {
composePathHelper: '配置文件保存路徑: {0}',
composeHelper: '通 1Panel 編輯或者模版創建的編排將保存在 {0}/docker/compose 路徑下',
deleteFile: '刪除文件',
deleteComposeHelper: '刪 {0} 目录下所有文件包括該文件下的持久化文件等請謹慎操作!',
allDelete: '徹底刪除',
deleteComposeHelper: '1. 刪除容器編排記錄 \n2. 刪除容器編排的所有文件包括配置文件和持久化文件',
deleteCompose: '" 刪除此編排',
apps: '應用商店',
local: '本',
Expand All @@ -753,6 +754,8 @@ const message = {
contentEmpty: '編排內容不能為空請輸入後重試!',
containerNumber: '容器數量',
containerStatus: '容器狀態',
exited: '已停止',
running: '運行中',
down: '刪',
up: '啟',
composeDetailHelper: '該 compose 1Panel 編排外部創建暫不支持啟停操作。',
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,13 +737,13 @@ const message = {
mirrorHelper:
'当存在多个加速器时需要换行显示\nhttp://xxxxxx.m.daocloud.io \nhttps://xxxxxx.mirror.aliyuncs.com',
registrieHelper: '当存在多个私有仓库时需要换行显示\n172.16.10.111:8081 \n172.16.10.112:8081',

compose: '编',
fromChangeHelper: '切换来源将清空当前已编辑内容是否继续?',
composePathHelper: '配置文件保存路径: {0}',
composeHelper: '通 1Panel 编辑或者模版创建的编排将保存在 {0}/docker/compose 路径下',
deleteFile: '删除文件',
deleteComposeHelper: '删 {0} 目录下所有文件包括该文件下的持久化文件等请谨慎操作!',
allDelete: '彻底删除',
deleteComposeHelper: '1. 删除容器编排记录 \n2. 删除容器编排的所有文件包括配置文件和持久化文件',
deleteCompose: '" 删除此编排',
apps: '应用商店',
local: '本',
Expand All @@ -756,6 +756,8 @@ const message = {
contentEmpty: '编排内容不能为空请输入后重试!',
containerNumber: '容器数量',
containerStatus: '容器状态',
exited: '已停止',
running: '运行中',
down: '删',
up: '启',
composeDetailHelper: '该 compose 1Panel 编排外部创建暂不支持启停操作。',
Expand Down
15 changes: 3 additions & 12 deletions frontend/src/views/container/compose/delete/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
>
<el-form ref="deleteForm" v-loading="loading">
<el-form-item>
<el-checkbox v-model="deleteFile" :label="$t('container.deleteFile')" />
<span class="input-help">
{{ $t('container.deleteComposeHelper', [loadComposeDir()]) }}
<el-checkbox v-model="deleteFile" :label="$t('container.allDelete')" />
<span class="input-help whitespace-break-spaces">
{{ $t('container.deleteComposeHelper') }}
</span>
</el-form-item>
<el-form-item>
Expand Down Expand Up @@ -64,15 +64,6 @@ const acceptParams = async (prop: DialogProps) => {
dialogVisible.value = true;
};
const loadComposeDir = () => {
const parts = composePath.value.split('/');
if (parts.length <= 2) {
return '/';
}
const parentDirectory = parts.slice(0, -1).join('/');
return parentDirectory;
};
const submit = async () => {
loading.value = true;
let params = {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/container/compose/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ const getContainerStatus = (containers) => {
const totalCount = safeContainers.length;
const statusText = runningCount > 0 ? 'Running' : 'Exited';
if (statusText === 'Exited') {
return `${statusText}`;
return i18n.global.t('container.exited');
} else {
return `${statusText} (${runningCount}/${totalCount})`;
return i18n.global.t('container.running') + ` (${runningCount}/${totalCount})`;
}
};
const backList = async () => {
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/views/host/file-management/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
<template #prompt>
<el-alert type="info" :closable="false">
<template #title>
<span v-html="$t('file.fileHeper')"></span>
<span class="input-help whitespace-break-spaces">
{{ $t('file.fileHeper') }}
</span>
</template>
</el-alert>
</template>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/views/website/runtime/go/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<template #prompt>
<el-alert type="info" :closable="false">
<template #title>
<span v-html="$t('runtime.statusHelper')"></span>
<span class="input-help whitespace-break-spaces">
{{ $t('runtime.statusHelper') }}
</span>
</template>
</el-alert>
</template>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/views/website/runtime/java/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<template #prompt>
<el-alert type="info" :closable="false">
<template #title>
<span v-html="$t('runtime.statusHelper')"></span>
<span class="input-help whitespace-break-spaces">
{{ $t('runtime.statusHelper') }}
</span>
</template>
</el-alert>
</template>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/views/website/runtime/node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<template #prompt>
<el-alert type="info" :closable="false">
<template #title>
<span v-html="$t('runtime.statusHelper')"></span>
<span class="input-help whitespace-break-spaces">
{{ $t('runtime.statusHelper') }}
</span>
</template>
</el-alert>
</template>
Expand Down

0 comments on commit 236a2df

Please sign in to comment.