Skip to content

Commit 1a62427

Browse files
committed
feat: Improve the internationalization of the frontend.
1 parent f52dc0f commit 1a62427

File tree

125 files changed

+5360
-1245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+5360
-1245
lines changed

agent/init/dir/dir.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package dir
33
import (
44
"path"
55

6-
"github.com/1Panel-dev/1Panel/agent/app/model"
7-
"github.com/1Panel-dev/1Panel/agent/constant"
86
"github.com/1Panel-dev/1Panel/agent/global"
97
"github.com/1Panel-dev/1Panel/agent/utils/files"
108
)
@@ -30,15 +28,4 @@ func Init() {
3028
global.Dir.RuntimeDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/runtime"))
3129
global.Dir.RecycleBinDir, _ = fileOp.CreateDirWithPath(true, "/.1panel_clash")
3230
global.Dir.SSLLogDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/log/ssl"))
33-
34-
loadLocalDir()
35-
}
36-
37-
func loadLocalDir() {
38-
var account model.BackupAccount
39-
if err := global.DB.Where("`type` = ?", constant.Local).First(&account).Error; err != nil {
40-
global.LOG.Errorf("load local backup account info failed, err: %v", err)
41-
return
42-
}
43-
global.Dir.LocalBackupDir = account.BackupPath
4431
}

agent/init/hook/hook.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ func Init() {
1717
initGlobalData()
1818
handleCronjobStatus()
1919
handleSnapStatus()
20+
21+
loadLocalDir()
2022
}
2123

2224
func initGlobalData() {
@@ -92,3 +94,12 @@ func handleCronJobAlert(cronjob *model.Cronjob) {
9294
return
9395
}
9496
}
97+
98+
func loadLocalDir() {
99+
var account model.BackupAccount
100+
if err := global.DB.Where("`type` = ?", constant.Local).First(&account).Error; err != nil {
101+
global.LOG.Errorf("load local backup account info failed, err: %v", err)
102+
return
103+
}
104+
global.Dir.LocalBackupDir = account.BackupPath
105+
}

frontend/src/components/app-status/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
:disabled="data.status === 'Installing'"
2929
@click="onOperate('restart')"
3030
>
31-
{{ $t('app.restart') }}
31+
{{ $t('commons.button.restart') }}
3232
</el-button>
3333
<el-divider direction="vertical" />
3434
<el-button

frontend/src/components/backup/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</div>
5050
</template>
5151
</el-table-column>
52-
<el-table-column :label="$t('database.source')" prop="backupType">
52+
<el-table-column :label="$t('app.source')" prop="backupType">
5353
<template #default="{ row }">
5454
<span v-if="row.accountType === 'LOCAL'">
5555
{{ $t('setting.LOCAL') }}

frontend/src/components/container-log/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</el-checkbox>
1919
</div>
2020
<el-button class="margin-button" @click="onDownload" icon="Download">
21-
{{ $t('file.download') }}
21+
{{ $t('commons.button.download') }}
2222
</el-button>
2323
<el-button class="margin-button" @click="onClean" icon="Delete">
2424
{{ $t('commons.button.clean') }}
@@ -89,7 +89,7 @@ const visibleLogs = computed(() => {
8989
});
9090
9191
const timeOptions = ref([
92-
{ label: i18n.global.t('container.all'), value: 'all' },
92+
{ label: i18n.global.t('commons.table.all'), value: 'all' },
9393
{
9494
label: i18n.global.t('container.lastDay'),
9595
value: '24h',
@@ -148,7 +148,7 @@ const searchLogs = async () => {
148148
const onDownload = async () => {
149149
logSearch.tail = 0;
150150
let msg = i18n.global.t('container.downLogHelper1', [logSearch.container]);
151-
ElMessageBox.confirm(msg, i18n.global.t('file.download'), {
151+
ElMessageBox.confirm(msg, i18n.global.t('commons.button.download'), {
152152
confirmButtonText: i18n.global.t('commons.button.confirm'),
153153
cancelButtonText: i18n.global.t('commons.button.cancel'),
154154
type: 'info',

frontend/src/components/log-dialog/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<DrawerPro v-model="open" :header="$t('website.log')" size="large" :back="handleClose">
2+
<DrawerPro v-model="open" :header="$t('commons.button.log')" size="large" :back="handleClose">
33
<LogFile :config="config" :height-diff="config.heightDiff"></LogFile>
44
</DrawerPro>
55
</template>

frontend/src/components/log-file/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
icon="Download"
1212
:disabled="logs.length === 0"
1313
>
14-
{{ $t('file.download') }}
14+
{{ $t('commons.button.download') }}
1515
</el-button>
1616
<span v-if="$slots.button" class="ml-2.5">
1717
<slot name="button"></slot>

frontend/src/components/task-list/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<Status :status="row.status" :msg="row.errorMsg" />
2323
</template>
2424
</el-table-column>
25-
<el-table-column :label="$t('website.log')" prop="log">
25+
<el-table-column :label="$t('commons.button.log')" prop="log">
2626
<template #default="{ row }">
2727
<el-button @click="openTaskLog(row)" link type="primary">
2828
{{ $t('website.check') }}

0 commit comments

Comments
 (0)