mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-06-04 13:30:32 +08:00
feat(i18n): update localization for knowledge bases and organization features
- Added new localization strings for 'Mine' in English and Chinese. - Enhanced organization subtitles to include agents in shared spaces. - Updated permission descriptions to clarify roles related to knowledge bases and agents. - Improved UI components to reflect new labels and permissions for better user experience. This update strengthens the localization support, ensuring clarity in knowledge base and organization functionalities across multiple languages.
This commit is contained in:
@@ -1096,6 +1096,7 @@ export default {
|
||||
sharedKnowledgeBases: 'Shared Knowledge Bases',
|
||||
sharedToOrgs: 'Shared to {count} space(s)',
|
||||
sharedLabel: 'Shared',
|
||||
myLabel: 'Mine',
|
||||
tabs: {
|
||||
all: 'All',
|
||||
myKnowledgeBases: 'My Knowledge Bases',
|
||||
@@ -2374,7 +2375,7 @@ export default {
|
||||
},
|
||||
organization: {
|
||||
title: 'Shared Spaces',
|
||||
subtitle: 'Create or join shared spaces to share knowledge bases with your team',
|
||||
subtitle: 'Create or join shared spaces to share knowledge bases and agents with your team',
|
||||
createOrg: 'Create Space',
|
||||
joinOrg: 'Join Space',
|
||||
name: 'Space Name',
|
||||
@@ -2560,15 +2561,16 @@ export default {
|
||||
nameTip: 'Use your team or project name for easy identification',
|
||||
descriptionTip: 'Describe the purpose and goals of the space',
|
||||
permissionsTitle: 'Member Permissions',
|
||||
permissionsDesc: 'Understand the permission scope of different roles in the space',
|
||||
permissionsDesc: 'Understand the permission scope of different roles for knowledge bases and agents in the space',
|
||||
permissionFeature: 'Permission Feature',
|
||||
fullAccess: 'Full Access',
|
||||
editAccess: 'Edit Access',
|
||||
viewAccess: 'View Only',
|
||||
adminPerm1: 'Manage space settings, members, and knowledge base shares',
|
||||
adminPerm2: 'Share and manage knowledge bases',
|
||||
adminPerm1: 'Manage space settings, members, and knowledge base & agent sharing',
|
||||
adminPerm2: 'Share and manage knowledge bases and agents',
|
||||
adminPerm3: 'Edit shared knowledge base content',
|
||||
adminPerm4: 'View and search knowledge bases',
|
||||
useSharedAgentsPerm: 'Use shared agents',
|
||||
shareKBPerm: 'Share knowledge bases to space',
|
||||
editorPerm1: 'Edit shared knowledge base content',
|
||||
editorPerm2: 'View and search knowledge bases',
|
||||
@@ -2578,7 +2580,7 @@ export default {
|
||||
viewerPerm3: 'Manage space settings',
|
||||
ownerNote: 'As the space creator, you will automatically become an admin with full permissions.',
|
||||
joinTitle: 'Join Space',
|
||||
joinDesc: 'Join an existing space with an invite code to access shared knowledge bases',
|
||||
joinDesc: 'Join an existing space with an invite code to access shared knowledge bases and agents',
|
||||
joinIllustration: 'Enter the invite code provided by the space admin to join',
|
||||
inviteCodeTip: 'The invite code is generated by space admins, please ask them for it',
|
||||
howToGetCode: 'How to get an invite code?',
|
||||
|
||||
@@ -1488,6 +1488,7 @@ export default {
|
||||
sharedKnowledgeBases: "共享的知识库",
|
||||
sharedToOrgs: "已共享给 {count} 个空间",
|
||||
sharedLabel: "共享",
|
||||
myLabel: "我的",
|
||||
tabs: {
|
||||
all: "全部",
|
||||
myKnowledgeBases: "我的知识库",
|
||||
@@ -2379,7 +2380,7 @@ export default {
|
||||
},
|
||||
organization: {
|
||||
title: "共享空间",
|
||||
subtitle: "创建或加入共享空间,与团队成员共享知识库",
|
||||
subtitle: "创建或加入共享空间,与团队成员共享知识库与智能体",
|
||||
createOrg: "创建空间",
|
||||
joinOrg: "加入空间",
|
||||
name: "空间名称",
|
||||
@@ -2565,15 +2566,16 @@ export default {
|
||||
nameTip: "建议使用团队或项目名称,便于成员识别",
|
||||
descriptionTip: "描述空间的用途和目标,帮助成员了解空间",
|
||||
permissionsTitle: "成员权限",
|
||||
permissionsDesc: "了解空间中不同角色的权限范围",
|
||||
permissionsDesc: "了解空间中不同角色对知识库与智能体的权限范围",
|
||||
permissionFeature: "权限功能",
|
||||
fullAccess: "完整权限",
|
||||
editAccess: "编辑权限",
|
||||
viewAccess: "只读权限",
|
||||
adminPerm1: "管理空间设置、成员及知识库共享",
|
||||
adminPerm2: "共享和管理知识库",
|
||||
adminPerm1: "管理空间设置、成员及知识库与智能体共享",
|
||||
adminPerm2: "共享和管理知识库与智能体",
|
||||
adminPerm3: "编辑共享知识库内容",
|
||||
adminPerm4: "查看和检索知识库",
|
||||
useSharedAgentsPerm: "使用共享智能体",
|
||||
shareKBPerm: "共享知识库到空间",
|
||||
editorPerm1: "编辑共享知识库内容",
|
||||
editorPerm2: "查看和检索知识库",
|
||||
@@ -2583,7 +2585,7 @@ export default {
|
||||
viewerPerm3: "管理空间设置",
|
||||
ownerNote: "作为空间创建者,您将自动成为空间的管理员,拥有完整权限。",
|
||||
joinTitle: "加入空间",
|
||||
joinDesc: "通过邀请码加入现有空间,获得知识库访问权限",
|
||||
joinDesc: "通过邀请码加入现有空间,获得知识库与智能体访问权限",
|
||||
joinIllustration: "输入空间管理员提供的邀请码即可加入",
|
||||
inviteCodeTip: "邀请码由空间管理员生成,请向他们索取",
|
||||
howToGetCode: "如何获取邀请码?",
|
||||
|
||||
@@ -170,7 +170,12 @@
|
||||
</t-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<span class="card-time">{{ kb.updated_at }}</span>
|
||||
<div class="bottom-right">
|
||||
<div class="personal-source">
|
||||
<t-icon name="user" size="14px" />
|
||||
<span>{{ $t('knowledgeList.myLabel') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -331,7 +336,12 @@
|
||||
</t-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<span class="card-time">{{ kb.updated_at }}</span>
|
||||
<div class="bottom-right">
|
||||
<div class="personal-source">
|
||||
<t-icon name="user" size="14px" />
|
||||
<span>{{ $t('knowledgeList.myLabel') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -354,7 +364,6 @@
|
||||
<t-tooltip :content="$t('knowledgeList.menu.viewDetails')" placement="top">
|
||||
<button type="button" class="shared-detail-trigger" @click.stop="openSharedDetail(shared)" :aria-label="$t('knowledgeList.menu.viewDetails')">
|
||||
<t-icon name="info-circle" size="16px" />
|
||||
<span>{{ $t('knowledgeList.menu.viewDetails') }}</span>
|
||||
</button>
|
||||
</t-tooltip>
|
||||
</div>
|
||||
@@ -1144,6 +1153,30 @@ const handleUploadFinishedEvent = (event: Event) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 「我的」知识库标签(与 .org-source 同套样式:灰字 + 绿标 + 浅绿底)
|
||||
.personal-source {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
padding: 3px 8px;
|
||||
background: rgba(7, 192, 95, 0.06);
|
||||
border-radius: 6px;
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
color: #4e5969;
|
||||
font-weight: 500;
|
||||
transition: background-color 0.15s ease;
|
||||
|
||||
span {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.t-icon {
|
||||
color: #07c05f;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.shared-kb-card {
|
||||
position: relative;
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.adminPerm2') }}</li>
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.adminPerm3') }}</li>
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.adminPerm4') }}</li>
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.useSharedAgentsPerm') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="permission-card">
|
||||
@@ -106,7 +107,8 @@
|
||||
<ul class="permission-list">
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.editorPerm1') }}</li>
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.editorPerm2') }}</li>
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.shareKBPerm') }}</li>
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.useSharedAgentsPerm') }}</li>
|
||||
<li><t-icon name="close" class="close-icon" />{{ $t('organization.editor.shareKBPerm') }}</li>
|
||||
<li><t-icon name="close" class="close-icon" />{{ $t('organization.editor.editorPerm3') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -122,6 +124,7 @@
|
||||
</div>
|
||||
<ul class="permission-list">
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.viewerPerm1') }}</li>
|
||||
<li><t-icon name="check" class="check-icon" />{{ $t('organization.editor.useSharedAgentsPerm') }}</li>
|
||||
<li><t-icon name="close" class="close-icon" />{{ $t('organization.editor.shareKBPerm') }}</li>
|
||||
<li><t-icon name="close" class="close-icon" />{{ $t('organization.editor.viewerPerm2') }}</li>
|
||||
<li><t-icon name="close" class="close-icon" />{{ $t('organization.editor.viewerPerm3') }}</li>
|
||||
|
||||
@@ -273,6 +273,7 @@
|
||||
<div class="perm-items">
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.viewerPerm1') }}</span>
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.editorPerm1') }}</span>
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.useSharedAgentsPerm') }}</span>
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.shareKBPerm') }}</span>
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.adminPerm1') }}</span>
|
||||
</div>
|
||||
@@ -286,7 +287,8 @@
|
||||
<div class="perm-items">
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.viewerPerm1') }}</span>
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.editorPerm1') }}</span>
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.shareKBPerm') }}</span>
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.useSharedAgentsPerm') }}</span>
|
||||
<span class="perm-item no"><t-icon name="close" size="12px" />{{ $t('organization.editor.shareKBPerm') }}</span>
|
||||
<span class="perm-item no"><t-icon name="close" size="12px" />{{ $t('organization.editor.adminPerm1') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -299,6 +301,7 @@
|
||||
<div class="perm-items">
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.viewerPerm1') }}</span>
|
||||
<span class="perm-item no"><t-icon name="close" size="12px" />{{ $t('organization.editor.editorPerm1') }}</span>
|
||||
<span class="perm-item has"><t-icon name="check" size="12px" />{{ $t('organization.editor.useSharedAgentsPerm') }}</span>
|
||||
<span class="perm-item no"><t-icon name="close" size="12px" />{{ $t('organization.editor.shareKBPerm') }}</span>
|
||||
<span class="perm-item no"><t-icon name="close" size="12px" />{{ $t('organization.editor.adminPerm1') }}</span>
|
||||
</div>
|
||||
|
||||
@@ -483,6 +483,12 @@ func (s *organizationService) JoinByInviteCode(ctx context.Context, inviteCode s
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// check if the organization need approval
|
||||
if org.RequireApproval {
|
||||
logger.Infof(ctx, "Organization %s requires approval", org.ID)
|
||||
return nil, ErrOrgPermissionDenied
|
||||
}
|
||||
|
||||
// Check if user is already a member
|
||||
_, err = s.orgRepo.GetMember(ctx, org.ID, userID)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user