1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 00:09:16 +08:00

feat: Improve and format language files (#7634)

This commit is contained in:
2025-01-03 16:52:09 +08:00 committed by GitHub
parent 2b18251360
commit ca0d24bf56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 311 additions and 160 deletions

View File

@ -29,7 +29,7 @@ type Login struct {
Captcha string `json:"captcha"` Captcha string `json:"captcha"`
CaptchaID string `json:"captchaID"` CaptchaID string `json:"captchaID"`
AuthMethod string `json:"authMethod" validate:"required,oneof=jwt session"` AuthMethod string `json:"authMethod" validate:"required,oneof=jwt session"`
Language string `json:"language" validate:"required,oneof=zh en tw ru"` Language string `json:"language" validate:"required,oneof=zh en tw ru ms"`
} }
type MFALogin struct { type MFALogin struct {

View File

@ -100,6 +100,7 @@ func Init() {
_, _ = bundle.LoadMessageFileFS(fs, "lang/fa.yaml") _, _ = bundle.LoadMessageFileFS(fs, "lang/fa.yaml")
_, _ = bundle.LoadMessageFileFS(fs, "lang/pt.yaml") _, _ = bundle.LoadMessageFileFS(fs, "lang/pt.yaml")
_, _ = bundle.LoadMessageFileFS(fs, "lang/ru.yaml") _, _ = bundle.LoadMessageFileFS(fs, "lang/ru.yaml")
_, _ = bundle.LoadMessageFileFS(fs, "lang/ms.yaml")
} }
func UseI18nForCmd(lang string) { func UseI18nForCmd(lang string) {

File diff suppressed because it is too large Load Diff

View File

@ -121,7 +121,7 @@
</el-select> </el-select>
</template> </template>
<template #body> <template #body>
<div style="position: relative; margin-top: 20px"> <div style="position: relative; margin-top: 60px">
<div class="monitor-tags" v-if="chartOption === 'network'"> <div class="monitor-tags" v-if="chartOption === 'network'">
<el-tag> <el-tag>
{{ $t('monitor.up') }}: {{ computeSizeFromKBs(currentChartInfo.netBytesSent) }} {{ $t('monitor.up') }}: {{ computeSizeFromKBs(currentChartInfo.netBytesSent) }}

View File

@ -62,6 +62,7 @@
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
<el-dropdown-item command="ru">Русский</el-dropdown-item> <el-dropdown-item command="ru">Русский</el-dropdown-item>
<el-dropdown-item command="ms">Bahasa Melayu</el-dropdown-item>
</template> </template>
</el-dropdown> </el-dropdown>
</div> </div>
@ -275,6 +276,8 @@ function handleCommand(command: string) {
dropdownText.value = '中文(繁體)'; dropdownText.value = '中文(繁體)';
} else if (command === 'ru') { } else if (command === 'ru') {
dropdownText.value = 'Русский'; dropdownText.value = 'Русский';
} else if (command === 'ms') {
dropdownText.value = 'Bahasa Melayu';
} }
nextTick(() => { nextTick(() => {
loginFormRef.value.clearValidate(); loginFormRef.value.clearValidate();

View File

@ -319,6 +319,7 @@ const languageOptions = ref([
{ value: 'tw', label: '中文(繁體)' }, { value: 'tw', label: '中文(繁體)' },
...(!globalStore.isIntl ? [{ value: 'en', label: 'English' }] : []), ...(!globalStore.isIntl ? [{ value: 'en', label: 'English' }] : []),
{ value: 'ru', label: 'Русский' }, { value: 'ru', label: 'Русский' },
{ value: 'ms', label: 'Bahasa Melayu' },
]); ]);
if (globalStore.isIntl) { if (globalStore.isIntl) {

View File

@ -257,7 +257,7 @@ const toFolder = (folder: string) => {
router.push({ path: '/hosts/files', query: { path: folder } }); router.push({ path: '/hosts/files', query: { path: folder } });
}; };
const toDoc = async () => { const toDoc = async () => {
window.open(docsUrl + '/user_manual/toolbox/clam/', '_blank', 'noopener,noreferrer'); window.open(docsUrl.value + '/user_manual/toolbox/clam/', '_blank', 'noopener,noreferrer');
}; };
const onChange = async (row: any) => { const onChange = async (row: any) => {