diff --git a/web/src/components/common/AppFooter.vue b/web/src/components/common/AppFooter.vue index 9afaa8d5..e2aacacb 100644 --- a/web/src/components/common/AppFooter.vue +++ b/web/src/components/common/AppFooter.vue @@ -1,11 +1,18 @@ + + - - diff --git a/web/src/components/common/CodeEditor.vue b/web/src/components/common/CodeEditor.vue index 3e395132..432c117f 100644 --- a/web/src/components/common/CodeEditor.vue +++ b/web/src/components/common/CodeEditor.vue @@ -3,7 +3,9 @@ import file from '@/api/panel/file' import { decodeBase64 } from '@/utils' import { languageByPath } from '@/utils/file' import Editor from '@guolao/vue-monaco-editor' +import { useGettext } from 'vue3-gettext' +const { $gettext } = useGettext() const props = defineProps({ path: { type: String, @@ -22,7 +24,7 @@ const get = () => { useRequest(file.content(props.path)) .onSuccess(({ data }) => { content.value = decodeBase64(data.content) - window.$message.success('获取成功') + window.$message.success($gettext('Retrieved successfully')) }) .onError(() => { disabled.value = true @@ -31,11 +33,11 @@ const get = () => { const save = () => { if (disabled.value) { - window.$message.error('当前状态下不可保存') + window.$message.error($gettext('Cannot save in current state')) return } useRequest(file.save(props.path, content.value)).onSuccess(() => { - window.$message.success('保存成功') + window.$message.success($gettext('Saved successfully')) }) } diff --git a/web/src/components/common/PathSelector.vue b/web/src/components/common/PathSelector.vue index ac167536..e9f28596 100644 --- a/web/src/components/common/PathSelector.vue +++ b/web/src/components/common/PathSelector.vue @@ -5,7 +5,9 @@ import { checkName, checkPath, getExt, getIconByExt } from '@/utils' import type { DataTableColumns, InputInst } from 'naive-ui' import { NButton, NDataTable, NEllipsis, NFlex, NTag } from 'naive-ui' import type { RowData } from 'naive-ui/es/data-table/src/interface' +import { useGettext } from 'vue3-gettext' +const { $gettext } = useGettext() const show = defineModel('show', { type: Boolean, required: true }) const path = defineModel('path', { type: String, required: true }) const props = defineProps({ @@ -15,7 +17,7 @@ const props = defineProps({ } }) -const title = computed(() => (props.dir ? '选择目录' : '选择文件')) +const title = computed(() => (props.dir ? $gettext('Select Directory') : $gettext('Select File'))) const isInput = ref(false) const pathInput = ref(null) const input = ref('www') @@ -37,7 +39,7 @@ const columns: DataTableColumns = [ } }, { - title: '名称', + title: $gettext('Name'), key: 'name', minWidth: 180, defaultSortOrder: false, @@ -78,7 +80,7 @@ const columns: DataTableColumns = [ } }, { - title: '权限', + title: $gettext('Permissions'), key: 'mode', minWidth: 80, render(row: any): any { @@ -90,7 +92,7 @@ const columns: DataTableColumns = [ } }, { - title: '所有者 / 组', + title: $gettext('Owner / Group'), key: 'owner/group', minWidth: 120, render(row: any): any { @@ -102,7 +104,7 @@ const columns: DataTableColumns = [ } }, { - title: '大小', + title: $gettext('Size'), key: 'size', minWidth: 80, render(row: any): any { @@ -110,7 +112,7 @@ const columns: DataTableColumns = [ } }, { - title: '修改时间', + title: $gettext('Modification Time'), key: 'modify', minWidth: 200, render(row: any): any { @@ -143,7 +145,7 @@ const handleInput = () => { const handleBlur = () => { input.value = input.value.replace(/(^\/)|(\/$)/g, '') if (!checkPath(input.value)) { - window.$message.error('路径不合法') + window.$message.error($gettext('Invalid path')) return } @@ -203,7 +205,7 @@ const showCreate = (value: string) => { const handleCreate = () => { if (!checkName(createModel.value.path)) { - window.$message.error('名称不合法') + window.$message.error($gettext('Invalid name')) return } @@ -211,7 +213,7 @@ const handleCreate = () => { useRequest(file.create(fullPath, createModel.value.dir)).onSuccess(() => { create.value = false refresh() - window.$message.success('新建成功') + window.$message.success($gettext('Created successfully')) }) } @@ -250,12 +252,12 @@ const handleClose = () => { - 新建 + {{ $gettext('Create') }} @@ -263,7 +265,9 @@ const handleClose = () => { - 根目录 + + {{ $gettext('Root Directory') }} + { { > - + - 提交 + {{ $gettext('Submit') }} diff --git a/web/src/components/common/RealtimeLog.vue b/web/src/components/common/RealtimeLog.vue index 4aeecd81..00204358 100644 --- a/web/src/components/common/RealtimeLog.vue +++ b/web/src/components/common/RealtimeLog.vue @@ -1,7 +1,9 @@