@@ -11,6 +11,7 @@ import { useDeployModal } from '../context/DeployModalContext';
11
11
import { appsConfig } from '../config/apps.config' ;
12
12
import history from "@lowcoder-ee/util/history" ;
13
13
import { messageInstance } from 'lowcoder-design/src/components/GlobalInstances' ;
14
+ import { trans } from 'i18n' ;
14
15
15
16
const { Search} = Input ;
16
17
@@ -117,10 +118,10 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
117
118
unmanaged :prev . total - managed
118
119
} ) ) ;
119
120
120
- messageInstance . success ( ` ${ app . name } is now ${ checked ? 'Managed' : 'Unmanaged' } ` ) ;
121
+ messageInstance . success ( trans ( checked ? "enterprise.environments.apps.managedSuccess" : "enterprise.environments.apps.unmanagedSuccess" , { name : app . name } ) ) ;
121
122
return true ;
122
123
} catch ( error ) {
123
- messageInstance . error ( `Failed to change managed status for ${ app . name } ` ) ;
124
+ messageInstance . error ( trans ( "enterprise.environments.apps.managedError" , { name : app . name } ) ) ;
124
125
return false ;
125
126
} finally {
126
127
setRefreshing ( false ) ;
@@ -141,7 +142,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
141
142
// Table columns
142
143
const columns = [
143
144
{
144
- title :'App' ,
145
+ title :trans ( "enterprise.environments.apps.app" ) ,
145
146
key :'app' ,
146
147
render :( app :App ) => (
147
148
< div style = { { display :'flex' , alignItems :'center' } } >
@@ -158,7 +159,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
158
159
< div style = { { display :'flex' , alignItems :'center' , gap :8 } } >
159
160
< span style = { { fontWeight :500 } } > { app . name } </ span >
160
161
{ app . applicationStatus === 'RECYCLED' && (
161
- < Tooltip title = "This app has been moved to recycle bin" >
162
+ < Tooltip title = { trans ( "enterprise.environments.apps.appRecycled" ) } >
162
163
< DeleteOutlined
163
164
style = { {
164
165
color :'#faad14' ,
@@ -176,24 +177,24 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
176
177
) ,
177
178
} ,
178
179
{
179
- title :'Status' ,
180
+ title :trans ( "enterprise.environments.apps.status" ) ,
180
181
key :'status' ,
181
182
render :( app :App ) => (
182
183
< Space direction = "vertical" size = { 0 } >
183
184
< Tag color = { app . published ?'success' :'default' } style = { { borderRadius :'4px' } } >
184
- { app . published ?< CheckCircleFilled /> :null } { app . published ?'Published' :'Draft' }
185
+ { app . published ?< CheckCircleFilled /> :null } { app . published ?trans ( "enterprise.environments.apps.published" ) :trans ( "enterprise.environments.apps.draft" ) }
185
186
</ Tag >
186
187
< Tag
187
188
color = { app . managed ?'processing' :'default' }
188
189
style = { { marginTop :8 , borderRadius :'4px' } }
189
190
>
190
- { app . managed ?< CloudServerOutlined /> :< DisconnectOutlined /> } { app . managed ?'Managed' :'Unmanaged' }
191
+ { app . managed ?< CloudServerOutlined /> :< DisconnectOutlined /> } { app . managed ?trans ( "enterprise.environments.apps.managed" ) :trans ( "enterprise.environments.apps.unmanaged" ) }
191
192
</ Tag >
192
193
</ Space >
193
194
) ,
194
195
} ,
195
196
{
196
- title :'Managed' ,
197
+ title :trans ( "enterprise.environments.apps.managed" ) ,
197
198
key :'managed' ,
198
199
render :( _ :any , app :App ) => (
199
200
< Switch
@@ -204,22 +205,22 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
204
205
) ,
205
206
} ,
206
207
{
207
- title :'Actions' ,
208
+ title :trans ( "enterprise.environments.workspaces.actions" ) ,
208
209
key :'actions' ,
209
210
render :( _ :any , app :App ) => (
210
211
< Space onClick = { ( e ) => e . stopPropagation ( ) } >
211
212
212
- < Tooltip title = { ! app . managed ?"App must be managed before it can be deployed" :"Deploy this app to another environment" } >
213
+ < Tooltip title = { ! app . managed ?trans ( "enterprise.environments.apps.appMustBeManagedToDeploy" ) :trans ( "enterprise.environments.apps.deployThisApp" ) } >
213
214
< Button
214
215
type = "primary"
215
216
icon = { < CloudUploadOutlined /> }
216
217
onClick = { ( ) => openDeployModal ( app , appsConfig , environment ) }
217
218
disabled = { ! app . managed }
218
219
>
219
- Deploy
220
+ { trans ( "enterprise.environments.apps.deploy" ) }
220
221
</ Button >
221
222
</ Tooltip >
222
- < Tooltip title = "View Audit Logs" >
223
+ < Tooltip title = { trans ( "enterprise.environments.apps.viewAuditLogs" ) } >
223
224
< Button
224
225
icon = { < AuditOutlined /> }
225
226
onClick = { ( e ) => {
@@ -228,7 +229,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
228
229
window . open ( auditUrl , '_blank' ) ;
229
230
} }
230
231
>
231
- Audit
232
+ { trans ( "enterprise.environments.apps.audit" ) }
232
233
</ Button >
233
234
</ Tooltip >
234
235
</ Space >
@@ -289,25 +290,25 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
289
290
} } >
290
291
< div >
291
292
< Title level = { 4 } style = { { margin :0 , marginBottom :'4px' } } >
292
- < AppstoreOutlined style = { { marginRight :8 } } /> Apps
293
+ < AppstoreOutlined style = { { marginRight :8 } } /> { trans ( "enterprise.environments.apps.title" ) }
293
294
</ Title >
294
295
< p style = { { marginBottom :0 , color :'#8c8c8c' , fontSize :'14px' } } >
295
- Manage workspace applications
296
+ { trans ( "enterprise.environments.apps.subtitle" ) }
296
297
</ p >
297
298
</ div >
298
299
< Button
299
300
icon = { < SyncOutlined spin = { refreshing } /> }
300
301
onClick = { handleRefresh }
301
302
loading = { loading }
302
303
>
303
- Refresh
304
+ { trans ( "enterprise.environments.apps.refresh" ) }
304
305
</ Button >
305
306
</ div >
306
307
307
308
{ /* Error display */ }
308
309
{ error && (
309
310
< Alert
310
- message = "Error loading apps"
311
+ message = { trans ( "enterprise.environments. apps.errorLoadingApps" ) }
311
312
description = { error }
312
313
type = "error"
313
314
showIcon
@@ -318,8 +319,8 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
318
319
{ /* Configuration warnings */ }
319
320
{ ( ! environment . environmentApikey || ! environment . environmentApiServiceUrl ) && ! error && (
320
321
< Alert
321
- message = "Configuration Issue"
322
- description = "Missing required configuration: API key or API service URL"
322
+ message = { trans ( "enterprise.environments.apps.configurationIssue" ) }
323
+ description = { trans ( "enterprise.environments.apps.missingConfiguration" ) }
323
324
type = "warning"
324
325
showIcon
325
326
style = { { marginBottom :"16px" } }
@@ -330,28 +331,28 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
330
331
< Row gutter = { [ 16 , 16 ] } style = { { marginBottom :'20px' } } >
331
332
< Col xs = { 12 } sm = { 12 } md = { 6 } >
332
333
< StatCard
333
- title = "Total Apps"
334
+ title = { trans ( "enterprise.environments.apps.totalApps" ) }
334
335
value = { stats . total }
335
336
icon = { < AppstoreOutlined /> }
336
337
/>
337
338
</ Col >
338
339
< Col xs = { 12 } sm = { 12 } md = { 6 } >
339
340
< StatCard
340
- title = "Published Apps"
341
+ title = { trans ( "enterprise.environments.apps.publishedApps" ) }
341
342
value = { stats . published }
342
343
icon = { < CheckCircleFilled /> }
343
344
/>
344
345
</ Col >
345
346
< Col xs = { 12 } sm = { 12 } md = { 6 } >
346
347
< StatCard
347
- title = "Managed Apps"
348
+ title = { trans ( "enterprise.environments.apps.managedApps" ) }
348
349
value = { stats . managed }
349
350
icon = { < CloudServerOutlined /> }
350
351
/>
351
352
</ Col >
352
353
< Col xs = { 12 } sm = { 12 } md = { 6 } >
353
354
< StatCard
354
- title = "Unmanaged Apps"
355
+ title = { trans ( "enterprise.environments.apps.unmanagedApps" ) }
355
356
value = { stats . unmanaged }
356
357
icon = { < DisconnectOutlined /> }
357
358
/>
@@ -371,15 +372,15 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
371
372
</ div >
372
373
) :apps . length === 0 ?(
373
374
< Empty
374
- description = { error || "No apps found in this workspace" }
375
+ description = { error || trans ( "enterprise.environments. apps.noAppsFound" ) }
375
376
image = { Empty . PRESENTED_IMAGE_SIMPLE }
376
377
/>
377
378
) :(
378
379
< >
379
380
{ /* Search and Filter Bar */ }
380
381
< div style = { { display :'flex' , justifyContent :'space-between' , marginBottom :16 } } >
381
382
< Search
382
- placeholder = "Search apps by name or ID"
383
+ placeholder = { trans ( "enterprise.environments. apps.searchApps" ) }
383
384
allowClear
384
385
onSearch = { value => setSearchText ( value ) }
385
386
onChange = { e => setSearchText ( e . target . value ) }
@@ -391,13 +392,13 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
391
392
icon = { < FilterOutlined /> }
392
393
style = { { marginLeft :'8px' } }
393
394
>
394
- { showManagedOnly ?'Show All' : 'Managed Only' }
395
+ { showManagedOnly ?trans ( "enterprise.environments.apps.showAll" ) : trans ( "enterprise.environments.apps.managedOnly" ) }
395
396
</ Button >
396
397
</ div >
397
398
398
399
{ searchText && displayedApps . length !== apps . length && (
399
400
< div style = { { marginBottom :16 , color :'#8c8c8c' , fontSize :'13px' } } >
400
- Showing { displayedApps . length } of { apps . length } apps
401
+ { trans ( "enterprise.environments.apps.showingResults" , { count : displayedApps . length , total : apps . length } ) }
401
402
</ div >
402
403
) }
403
404
@@ -407,7 +408,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
407
408
rowKey = "applicationId"
408
409
pagination = { {
409
410
pageSize :10 ,
410
- showTotal :( total , range ) => ` ${ range [ 0 ] } - ${ range [ 1 ] } of ${ total } apps` ,
411
+ showTotal :( total , range ) => trans ( "enterprise.environments.apps.paginationTotal" , { start : range [ 0 ] , end : range [ 1 ] , total} ) ,
411
412
size :'small'
412
413
} }
413
414
size = "middle"