mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Translate fixed name
This commit is contained in:
parent
6faa72d0b7
commit
3a267ac074
|
|
@ -43,7 +43,7 @@
|
|||
<div class="flex align-center">
|
||||
<AppIcon iconName="app-folder" style="font-size: 20px"></AppIcon>
|
||||
<span class="ml-8 ellipsis tree-label" style="max-width: 110px" :title="node.label">{{
|
||||
node.label
|
||||
i18n_name(node.label)
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
|
|
@ -103,6 +103,7 @@ import { onBeforeRouteLeave } from 'vue-router'
|
|||
import type { TreeInstance } from 'element-plus'
|
||||
import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import folderApi from '@/api/folder'
|
||||
import { EditionConst } from '@/utils/permission/data'
|
||||
import { hasPermission } from '@/utils/permission/index'
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<el-button text style="font-size: 14px" class="workspace-dropdown__button">
|
||||
<AppIcon iconName="app-workspace" style="font-size: 18px"></AppIcon>
|
||||
<span class="ellipsis" style="max-width: 155px" :title="currentWorkspace?.name">
|
||||
{{ currentWorkspace?.name }}
|
||||
{{ i18n_name(currentWorkspace?.name) }}
|
||||
</span>
|
||||
<el-icon class="el-icon--right">
|
||||
<CaretBottom />
|
||||
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { watch, ref } from 'vue'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import type { WorkspaceItem } from '@/api/type/workspace'
|
||||
import useStore from '@/stores'
|
||||
const props = defineProps({
|
||||
|
|
|
|||
|
|
@ -23,7 +23,10 @@ export default {
|
|||
authorize: 'Authorized',
|
||||
inner_admin: 'System Admin',
|
||||
inner_wsm: 'Workspace Manager',
|
||||
inner_user: 'Common User',
|
||||
inner_user: 'Regular User',
|
||||
root: 'Root Directory',
|
||||
default_workspace: 'Default Workspace',
|
||||
default_user_group: 'Default User Group',
|
||||
},
|
||||
time: {
|
||||
daysLater: 'days later',
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ export default {
|
|||
inner_admin: '系统管理员',
|
||||
inner_wsm: '工作空间管理员',
|
||||
inner_user: '普通用户',
|
||||
|
||||
root: '根目录',
|
||||
default_workspace: '默认工作空间',
|
||||
default_user_group: '默认用户组',
|
||||
},
|
||||
time: {
|
||||
daysLater: '天后',
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ export default {
|
|||
inner_admin: '系統管理員',
|
||||
inner_wsm: '工作空間管理員',
|
||||
inner_user: '普通用戶',
|
||||
root: '根目錄',
|
||||
default_workspace: '預設工作空間',
|
||||
default_user_group: '預設使用者群組',
|
||||
},
|
||||
time: {
|
||||
daysLater: '天後',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import {nanoid} from 'nanoid'
|
||||
import {t} from '@/locales'
|
||||
|
||||
/**
|
||||
* 数字处理
|
||||
|
|
@ -85,6 +86,22 @@ export function downloadByURL(url: string, name: string) {
|
|||
document.body.removeChild(a)
|
||||
}
|
||||
|
||||
// 替换固定数据国际化
|
||||
const i18n_default_name_map:any = {
|
||||
"系统管理员": 'layout.about.inner_admin',
|
||||
"工作空间管理员": 'layout.about.inner_wsm',
|
||||
"普通用户": 'layout.about.inner_user',
|
||||
"根目录": 'layout.about.root',
|
||||
"默认工作空间": 'layout.about.default_workspace',
|
||||
"默认用户组": 'layout.about.default_user_group',
|
||||
}
|
||||
|
||||
export function i18n_name(name: string) {
|
||||
const key = i18n_default_name_map[name]
|
||||
return key ? t(key) : name
|
||||
}
|
||||
|
||||
|
||||
// 截取文件名
|
||||
export function cutFilename(filename: string, num: number) {
|
||||
const lastIndex = filename.lastIndexOf('.')
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ item.nick_name }}
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
</el-text>
|
||||
</template>
|
||||
</CardBox>
|
||||
|
|
@ -197,7 +197,7 @@
|
|||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
<auto-tooltip :content="item.username">
|
||||
{{ $t('common.creator') }}: {{ item.nick_name }}
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
</auto-tooltip>
|
||||
</el-text>
|
||||
</template>
|
||||
|
|
@ -330,6 +330,7 @@ import ApplicationApi from '@/api/application/application'
|
|||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||
import useStore from '@/stores'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { isWorkFlow } from '@/utils/application'
|
||||
import { resetUrl } from '@/utils/common'
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ item.nick_name }}
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
</el-text>
|
||||
</template>
|
||||
</CardBox>
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ item.nick_name }}
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
</el-text>
|
||||
</template>
|
||||
<template #tag>
|
||||
|
|
@ -361,6 +361,7 @@ import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
|||
import useStore from '@/stores'
|
||||
import { numberFormat } from '@/utils/common'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import { SourceTypeEnum } from '@/enums/common'
|
||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||
import permissionMap from '@/permission'
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ model.nick_name }}
|
||||
{{ $t('common.creator') }}: {{ i18n_name(model.nick_name) }}
|
||||
</el-text>
|
||||
</template>
|
||||
<template #tag>
|
||||
|
|
@ -145,6 +145,7 @@ import AuthorizedWorkspace from '@/views/system-shared/AuthorizedWorkspaceDialog
|
|||
import ResourceAuthorizationDrawer from '@/components/resource-authorization-drawer/index.vue'
|
||||
import { SourceTypeEnum } from '@/enums/common'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import permissionMap from '@/permission'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
>
|
||||
<template #default="{ row }">
|
||||
<div class="flex-between">
|
||||
<span class="ellipsis" :title="row.name">{{ row.name }}</span>
|
||||
<span class="ellipsis" :title="row.name">{{ i18n_name(row.name) }}</span>
|
||||
<div @click.stop v-show="mouseId === row.id">
|
||||
<el-dropdown
|
||||
:teleported="false"
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
<!-- 右边 -->
|
||||
<div class="user-right" v-loading="rightLoading">
|
||||
<div class="flex align-center">
|
||||
<h4 class="medium ellipsis" :title="current?.name">{{ current?.name }}</h4>
|
||||
<h4 class="medium ellipsis" :title="current?.name">{{ i18n_name(current?.name as string) }}</h4>
|
||||
<el-divider direction="vertical" class="mr-8 ml-8" />
|
||||
<AppIcon
|
||||
iconName="app-workspace"
|
||||
|
|
@ -269,6 +269,7 @@
|
|||
import { onMounted, ref, watch, reactive } from 'vue'
|
||||
import SystemGroupApi from '@/api/system/user-group'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import type { ChatUserGroupUserItem } from '@/api/type/systemChatUser'
|
||||
import CreateOrUpdateGroupDialog from './component/CreateOrUpdateGroupDialog.vue'
|
||||
import CreateGroupUserDialog from './component/CreateGroupUserDialog.vue'
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
@mouseleave="mouseId = ''"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span class="ellipsis-1" :title="row.role_name">{{ row.role_name }}</span>
|
||||
<span class="ellipsis-1" :title="row.role_name">{{ i18n_name(row.role_name) }}</span>
|
||||
</template>
|
||||
<template #empty>
|
||||
<span></span>
|
||||
|
|
@ -119,7 +119,7 @@
|
|||
<div class="flex-between mb-16">
|
||||
<div class="flex align-center">
|
||||
<h4>
|
||||
{{ currentRole?.role_name }}
|
||||
{{ i18n_name(currentRole?.role_name as string) }}
|
||||
</h4>
|
||||
<span
|
||||
v-if="currentRole?.type && !currentRole.internal"
|
||||
|
|
@ -155,6 +155,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import PermissionConfiguration from './component/PermissionConfiguration.vue'
|
||||
import Member from './component/Member.vue'
|
||||
import CreateOrUpdateRoleDialog from './component/CreateOrUpdateRoleDialog.vue'
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
>
|
||||
<template #default="{ row }">
|
||||
<div class="flex-between">
|
||||
<span class="ellipsis" :title="row.name">{{ row.name }}</span>
|
||||
<span class="ellipsis" :title="row.name">{{ i18n_name(row.name) }}</span>
|
||||
<div @click.stop v-show="mouseId === row.id">
|
||||
<el-dropdown
|
||||
:teleported="false"
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
<!-- 右边 -->
|
||||
<div class="workspace-right p-24" v-loading="loading">
|
||||
<div class="flex align-center mb-16">
|
||||
<h4 class="medium">{{ currentWorkspace?.name }}</h4>
|
||||
<h4 class="medium">{{ i18n_name(currentWorkspace?.name as string) }}</h4>
|
||||
<el-divider direction="vertical" class="mr-8 ml-8" />
|
||||
<el-icon class="color-input-placeholder"><UserFilled /></el-icon>
|
||||
<span class="color-input-placeholder ml-4">
|
||||
|
|
@ -106,6 +106,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import Member from './component/Member.vue'
|
||||
import CreateOrUpdateWorkspaceDialog from './component/CreateOrUpdateWorkspaceDialog.vue'
|
||||
import type { WorkspaceItem } from '@/api/type/workspace'
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ item.nick_name }}
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
</el-text>
|
||||
</template>
|
||||
</CardBox>
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
</template>
|
||||
<template #subTitle>
|
||||
<el-text class="color-secondary lighter" size="small">
|
||||
{{ $t('common.creator') }}: {{ item.nick_name }}
|
||||
{{ $t('common.creator') }}: {{ i18n_name(item.nick_name) }}
|
||||
</el-text>
|
||||
</template>
|
||||
<template #tag="{ hoverShow }">
|
||||
|
|
@ -383,6 +383,7 @@ import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
|||
import permissionMap from '@/permission'
|
||||
import useStore from '@/stores'
|
||||
import { t } from '@/locales'
|
||||
import { i18n_name } from '@/utils/common'
|
||||
import ToolStoreApi from '@/api/tool/store.ts'
|
||||
import ToolStoreDescDrawer from "@/views/tool/component/ToolStoreDescDrawer.vue";
|
||||
const route = useRoute()
|
||||
|
|
|
|||
Loading…
Reference in New Issue