Skip to content

Commit 6e3ba72

Browse files
committed
add translations for workspace and usergroup tabs
1 parent 4ea9653 commit 6e3ba72

File tree

3 files changed

+103
-50
lines changed

3 files changed

+103
-50
lines changed

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,6 +2665,57 @@ export const en = {
26652665
"currentlyMaster": "Currently Master",
26662666
"configurationRequirements": "Configuration Requirements",
26672667
"configurationRequirementsDesc": "Ensure that the API Service URL is configured and correct, the API key is valid, and for license verification make sure you have both the license and plugin properly installed."
2668+
},
2669+
"workspaces": {
2670+
"title": "Workspaces",
2671+
"subtitle": "Manage workspaces in this environment",
2672+
"refresh": "Refresh",
2673+
"errorLoadingWorkspaces": "Error loading workspaces",
2674+
"configurationIssue": "Configuration Issue",
2675+
"missingConfiguration": "Missing required configuration: API key or API service URL",
2676+
"totalWorkspaces": "Total Workspaces",
2677+
"managedWorkspaces": "Managed Workspaces",
2678+
"unmanagedWorkspaces": "Unmanaged Workspaces",
2679+
"workspace": "Workspace",
2680+
"role": "Role",
2681+
"status": "Status",
2682+
"managed": "Managed",
2683+
"unmanaged": "Unmanaged",
2684+
"actions": "Actions",
2685+
"viewAuditLogs": "View Audit Logs",
2686+
"audit": "Audit",
2687+
"searchWorkspaces": "Search workspaces by name or ID",
2688+
"showAll": "Show All",
2689+
"managedOnly": "Managed Only",
2690+
"showingResults": "Showing {count} of {total} workspaces",
2691+
"paginationTotal": "{start}-{end} of {total} workspaces",
2692+
"noWorkspacesFound": "No workspaces found in this environment"
2693+
},
2694+
"userGroups": {
2695+
"title": "User Groups",
2696+
"subtitle": "Manage user groups in this environment",
2697+
"refresh": "Refresh",
2698+
"errorLoadingUserGroups": "Error loading user groups",
2699+
"configurationIssue": "Configuration Issue",
2700+
"missingConfiguration": "Missing required configuration: API key or API service URL",
2701+
"totalGroups": "Total Groups",
2702+
"allUsersGroups": "All Users Groups",
2703+
"developerGroups": "Developer Groups",
2704+
"customGroups": "Custom Groups",
2705+
"userGroup": "User Group",
2706+
"type": "Type",
2707+
"allUsers": "All Users",
2708+
"developers": "Developers",
2709+
"custom": "Custom",
2710+
"members": "Members",
2711+
"adminMembers": "Admin Members",
2712+
"created": "Created",
2713+
"totalMembersTooltip": "Total number of members in this group",
2714+
"adminMembersTooltip": "Number of admin users in this group",
2715+
"searchUserGroups": "Search user groups by name or ID",
2716+
"showingResults": "Showing {count} of {total} user groups",
2717+
"paginationTotal": "{start}-{end} of {total} user groups",
2718+
"noUserGroupsFound": "No user groups found in this environment"
26682719
}
26692720
}
26702721
},

client/packages/lowcoder/src/pages/setting/environments/components/UserGroupsTab.tsx

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Environment } from '../types/environment.types';
66
import { UserGroup, UserGroupsTabStats } from '../types/userGroup.types';
77
import { getEnvironmentUserGroups } from '../services/environments.service';
88
import { Spin, Empty } from 'antd';
9+
import { trans } from 'i18n';
910

1011
const { Search } = Input;
1112

@@ -36,7 +37,7 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
3637
try {
3738
// Check for required environment properties
3839
if (!environment.environmentApikey || !environment.environmentApiServiceUrl) {
39-
setError('Missing required configuration: API key or API service URL');
40+
setError(trans("enterprise.environments.userGroups.missingConfiguration"));
4041
setLoading(false);
4142
return;
4243
}
@@ -65,7 +66,7 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
6566
custom
6667
});
6768
} catch (err) {
68-
setError(err instanceof Error ? err.message : "Failed to fetch user groups");
69+
setError(err instanceof Error ? err.message : trans("enterprise.environments.userGroups.errorLoadingUserGroups"));
6970
} finally {
7071
setLoading(false);
7172
setRefreshing(false);
@@ -134,7 +135,7 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
134135
// Table columns
135136
const columns = [
136137
{
137-
title: 'User Group',
138+
title: trans("enterprise.environments.userGroups.userGroup"),
138139
key: 'group',
139140
render: (group: UserGroup) => (
140141
<div style={{ display: 'flex', alignItems: 'center' }}>
@@ -158,50 +159,50 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
158159
),
159160
},
160161
{
161-
title: 'Type',
162+
title: trans("enterprise.environments.userGroups.type"),
162163
key: 'type',
163164
render: (_: any, group: UserGroup) => {
164165
if (group.allUsersGroup) return (
165166
<Tag color="blue" style={{ borderRadius: '4px' }}>
166-
<UserOutlined style={{ marginRight: 4 }} /> All Users
167+
<UserOutlined style={{ marginRight: 4 }} /> {trans("enterprise.environments.userGroups.allUsers")}
167168
</Tag>
168169
);
169170
if (group.devGroup) return (
170171
<Tag color="purple" style={{ borderRadius: '4px' }}>
171-
<CodeOutlined style={{ marginRight: 4 }} /> Developers
172+
<CodeOutlined style={{ marginRight: 4 }} /> {trans("enterprise.environments.userGroups.developers")}
172173
</Tag>
173174
);
174175
return (
175176
<Tag color="default" style={{ borderRadius: '4px' }}>
176-
<SettingOutlined style={{ marginRight: 4 }} /> Custom
177+
<SettingOutlined style={{ marginRight: 4 }} /> {trans("enterprise.environments.userGroups.custom")}
177178
</Tag>
178179
);
179180
},
180181
},
181182
{
182-
title: 'Members',
183+
title: trans("enterprise.environments.userGroups.members"),
183184
key: 'members',
184185
render: (_: any, group: UserGroup) => (
185-
<Tooltip title="Total number of members in this group">
186+
<Tooltip title={trans("enterprise.environments.userGroups.totalMembersTooltip")}>
186187
<Tag style={{ borderRadius: '4px', backgroundColor: '#f6f6f6', color: '#333' }}>
187188
<UserOutlined style={{ marginRight: 4 }} /> {group.stats?.userCount || 0}
188189
</Tag>
189190
</Tooltip>
190191
),
191192
},
192193
{
193-
title: 'Admin Members',
194+
title: trans("enterprise.environments.userGroups.adminMembers"),
194195
key: 'adminMembers',
195196
render: (_: any, group: UserGroup) => (
196-
<Tooltip title="Number of admin users in this group">
197+
<Tooltip title={trans("enterprise.environments.userGroups.adminMembersTooltip")}>
197198
<Tag style={{ borderRadius: '4px', backgroundColor: '#fff1f0', color: '#cf1322' }}>
198199
<UserOutlined style={{ marginRight: 4 }} /> {group.stats?.adminUserCount || 0}
199200
</Tag>
200201
</Tooltip>
201202
),
202203
},
203204
{
204-
title: 'Created',
205+
title: trans("enterprise.environments.userGroups.created"),
205206
dataIndex: 'createTime',
206207
key: 'createTime',
207208
render: (createTime: number) => (
@@ -223,25 +224,25 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
223224
}}>
224225
<div>
225226
<Title level={4} style={{ margin: 0, marginBottom: '4px' }}>
226-
<UsergroupAddOutlined style={{ marginRight: 8 }} /> User Groups
227+
<UsergroupAddOutlined style={{ marginRight: 8 }} /> {trans("enterprise.environments.userGroups.title")}
227228
</Title>
228229
<p style={{ marginBottom: 0, color: '#8c8c8c', fontSize: '14px' }}>
229-
Manage user groups in this environment
230+
{trans("enterprise.environments.userGroups.subtitle")}
230231
</p>
231232
</div>
232233
<Button
233234
icon={<SyncOutlined spin={refreshing} />}
234235
onClick={handleRefresh}
235236
loading={loading}
236237
>
237-
Refresh
238+
{trans("enterprise.environments.userGroups.refresh")}
238239
</Button>
239240
</div>
240241

241242
{/* Error display */}
242243
{error && (
243244
<Alert
244-
message="Error loading user groups"
245+
message={trans("enterprise.environments.userGroups.errorLoadingUserGroups")}
245246
description={error}
246247
type="error"
247248
showIcon
@@ -252,8 +253,8 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
252253
{/* Configuration warnings */}
253254
{(!environment.environmentApikey || !environment.environmentApiServiceUrl) && !error && (
254255
<Alert
255-
message="Configuration Issue"
256-
description="Missing required configuration: API key or API service URL"
256+
message={trans("enterprise.environments.userGroups.configurationIssue")}
257+
description={trans("enterprise.environments.userGroups.missingConfiguration")}
257258
type="warning"
258259
showIcon
259260
style={{ marginBottom: "16px" }}
@@ -264,28 +265,28 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
264265
<Row gutter={[16, 16]} style={{ marginBottom: '20px' }}>
265266
<Col xs={24} sm={12} md={6}>
266267
<StatCard
267-
title="Total Groups"
268+
title={trans("enterprise.environments.userGroups.totalGroups")}
268269
value={stats.total}
269270
icon={<TeamOutlined />}
270271
/>
271272
</Col>
272273
<Col xs={24} sm={12} md={6}>
273274
<StatCard
274-
title="All Users Groups"
275+
title={trans("enterprise.environments.userGroups.allUsersGroups")}
275276
value={stats.allUsers}
276277
icon={<UserOutlined />}
277278
/>
278279
</Col>
279280
<Col xs={24} sm={12} md={6}>
280281
<StatCard
281-
title="Developer Groups"
282+
title={trans("enterprise.environments.userGroups.developerGroups")}
282283
value={stats.developers}
283284
icon={<CodeOutlined />}
284285
/>
285286
</Col>
286287
<Col xs={24} sm={12} md={6}>
287288
<StatCard
288-
title="Custom Groups"
289+
title={trans("enterprise.environments.userGroups.customGroups")}
289290
value={stats.custom}
290291
icon={<SettingOutlined />}
291292
/>
@@ -305,23 +306,23 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
305306
</div>
306307
) : userGroups.length === 0 ? (
307308
<Empty
308-
description={error || "No user groups found in this environment"}
309+
description={error || trans("enterprise.environments.userGroups.noUserGroupsFound")}
309310
image={Empty.PRESENTED_IMAGE_SIMPLE}
310311
/>
311312
) : (
312313
<>
313314
{/* Search Bar */}
314315
<div style={{ marginBottom: 16 }}>
315316
<Search
316-
placeholder="Search user groups by name or ID"
317+
placeholder={trans("enterprise.environments.userGroups.searchUserGroups")}
317318
allowClear
318319
onSearch={value => setSearchText(value)}
319320
onChange={e => setSearchText(e.target.value)}
320321
style={{ width: 300 }}
321322
/>
322323
{searchText && filteredUserGroups.length !== userGroups.length && (
323324
<div style={{ marginTop: 8, color: '#8c8c8c', fontSize: '13px' }}>
324-
Showing {filteredUserGroups.length} of {userGroups.length} user groups
325+
{trans("enterprise.environments.userGroups.showingResults", { count: filteredUserGroups.length, total: userGroups.length })}
325326
</div>
326327
)}
327328
</div>
@@ -332,7 +333,7 @@ const UserGroupsTab: React.FC<UserGroupsTabProps> = ({ environment }) => {
332333
rowKey="groupId"
333334
pagination={{
334335
pageSize: 10,
335-
showTotal: (total, range) => `${range[0]}-${range[1]} of ${total} user groups`,
336+
showTotal: (total, range) => trans("enterprise.environments.userGroups.paginationTotal", { start: range[0], end: range[1], total }),
336337
size: 'small'
337338
}}
338339
size="middle"

0 commit comments

Comments
 (0)