@@ -11,6 +11,7 @@ import { useDeployModal } from '../context/DeployModalContext';
1111import { appsConfig } from '../config/apps.config' ;
1212import history from "@lowcoder-ee/util/history" ;
1313import { messageInstance } from 'lowcoder-design/src/components/GlobalInstances' ;
14+ import { trans } from 'i18n' ;
1415
1516const { Search } = Input ;
1617
@@ -117,10 +118,10 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
117118 unmanaged : prev . total - managed
118119 } ) ) ;
119120
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 } ) ) ;
121122 return true ;
122123 } catch ( error ) {
123- messageInstance . error ( `Failed to change managed status for ${ app . name } ` ) ;
124+ messageInstance . error ( trans ( "enterprise.environments.apps.managedError" , { name : app . name } ) ) ;
124125 return false ;
125126 } finally {
126127 setRefreshing ( false ) ;
@@ -141,7 +142,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
141142 // Table columns
142143 const columns = [
143144 {
144- title : 'App' ,
145+ title : trans ( "enterprise.environments.apps.app" ) ,
145146 key : 'app' ,
146147 render : ( app : App ) => (
147148 < div style = { { display : 'flex' , alignItems : 'center' } } >
@@ -158,7 +159,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
158159 < div style = { { display : 'flex' , alignItems : 'center' , gap : 8 } } >
159160 < span style = { { fontWeight : 500 } } > { app . name } </ span >
160161 { app . applicationStatus === 'RECYCLED' && (
161- < Tooltip title = "This app has been moved to recycle bin" >
162+ < Tooltip title = { trans ( "enterprise.environments.apps.appRecycled" ) } >
162163 < DeleteOutlined
163164 style = { {
164165 color : '#faad14' ,
@@ -176,24 +177,24 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
176177 ) ,
177178 } ,
178179 {
179- title : 'Status' ,
180+ title : trans ( "enterprise.environments.apps.status" ) ,
180181 key : 'status' ,
181182 render : ( app : App ) => (
182183 < Space direction = "vertical" size = { 0 } >
183184 < 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" ) }
185186 </ Tag >
186187 < Tag
187188 color = { app . managed ? 'processing' : 'default' }
188189 style = { { marginTop : 8 , borderRadius : '4px' } }
189190 >
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" ) }
191192 </ Tag >
192193 </ Space >
193194 ) ,
194195 } ,
195196 {
196- title : 'Managed' ,
197+ title : trans ( "enterprise.environments.apps.managed" ) ,
197198 key : 'managed' ,
198199 render : ( _ : any , app : App ) => (
199200 < Switch
@@ -204,22 +205,22 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
204205 ) ,
205206 } ,
206207 {
207- title : 'Actions' ,
208+ title : trans ( "enterprise.environments.workspaces.actions" ) ,
208209 key : 'actions' ,
209210 render : ( _ : any , app : App ) => (
210211 < Space onClick = { ( e ) => e . stopPropagation ( ) } >
211212
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" ) } >
213214 < Button
214215 type = "primary"
215216 icon = { < CloudUploadOutlined /> }
216217 onClick = { ( ) => openDeployModal ( app , appsConfig , environment ) }
217218 disabled = { ! app . managed }
218219 >
219- Deploy
220+ { trans ( "enterprise.environments.apps.deploy" ) }
220221 </ Button >
221222 </ Tooltip >
222- < Tooltip title = "View Audit Logs" >
223+ < Tooltip title = { trans ( "enterprise.environments.apps.viewAuditLogs" ) } >
223224 < Button
224225 icon = { < AuditOutlined /> }
225226 onClick = { ( e ) => {
@@ -228,7 +229,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
228229 window . open ( auditUrl , '_blank' ) ;
229230 } }
230231 >
231- Audit
232+ { trans ( "enterprise.environments.apps.audit" ) }
232233 </ Button >
233234 </ Tooltip >
234235 </ Space >
@@ -289,25 +290,25 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
289290 } } >
290291 < div >
291292 < Title level = { 4 } style = { { margin : 0 , marginBottom : '4px' } } >
292- < AppstoreOutlined style = { { marginRight : 8 } } /> Apps
293+ < AppstoreOutlined style = { { marginRight : 8 } } /> { trans ( "enterprise.environments.apps.title" ) }
293294 </ Title >
294295 < p style = { { marginBottom : 0 , color : '#8c8c8c' , fontSize : '14px' } } >
295- Manage workspace applications
296+ { trans ( "enterprise.environments.apps.subtitle" ) }
296297 </ p >
297298 </ div >
298299 < Button
299300 icon = { < SyncOutlined spin = { refreshing } /> }
300301 onClick = { handleRefresh }
301302 loading = { loading }
302303 >
303- Refresh
304+ { trans ( "enterprise.environments.apps.refresh" ) }
304305 </ Button >
305306 </ div >
306307
307308 { /* Error display */ }
308309 { error && (
309310 < Alert
310- message = "Error loading apps"
311+ message = { trans ( "enterprise.environments. apps.errorLoadingApps" ) }
311312 description = { error }
312313 type = "error"
313314 showIcon
@@ -318,8 +319,8 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
318319 { /* Configuration warnings */ }
319320 { ( ! environment . environmentApikey || ! environment . environmentApiServiceUrl ) && ! error && (
320321 < 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" ) }
323324 type = "warning"
324325 showIcon
325326 style = { { marginBottom : "16px" } }
@@ -330,28 +331,28 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
330331 < Row gutter = { [ 16 , 16 ] } style = { { marginBottom : '20px' } } >
331332 < Col xs = { 12 } sm = { 12 } md = { 6 } >
332333 < StatCard
333- title = "Total Apps"
334+ title = { trans ( "enterprise.environments.apps.totalApps" ) }
334335 value = { stats . total }
335336 icon = { < AppstoreOutlined /> }
336337 />
337338 </ Col >
338339 < Col xs = { 12 } sm = { 12 } md = { 6 } >
339340 < StatCard
340- title = "Published Apps"
341+ title = { trans ( "enterprise.environments.apps.publishedApps" ) }
341342 value = { stats . published }
342343 icon = { < CheckCircleFilled /> }
343344 />
344345 </ Col >
345346 < Col xs = { 12 } sm = { 12 } md = { 6 } >
346347 < StatCard
347- title = "Managed Apps"
348+ title = { trans ( "enterprise.environments.apps.managedApps" ) }
348349 value = { stats . managed }
349350 icon = { < CloudServerOutlined /> }
350351 />
351352 </ Col >
352353 < Col xs = { 12 } sm = { 12 } md = { 6 } >
353354 < StatCard
354- title = "Unmanaged Apps"
355+ title = { trans ( "enterprise.environments.apps.unmanagedApps" ) }
355356 value = { stats . unmanaged }
356357 icon = { < DisconnectOutlined /> }
357358 />
@@ -371,15 +372,15 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
371372 </ div >
372373 ) : apps . length === 0 ? (
373374 < Empty
374- description = { error || "No apps found in this workspace" }
375+ description = { error || trans ( "enterprise.environments. apps.noAppsFound" ) }
375376 image = { Empty . PRESENTED_IMAGE_SIMPLE }
376377 />
377378 ) : (
378379 < >
379380 { /* Search and Filter Bar */ }
380381 < div style = { { display : 'flex' , justifyContent : 'space-between' , marginBottom : 16 } } >
381382 < Search
382- placeholder = "Search apps by name or ID"
383+ placeholder = { trans ( "enterprise.environments. apps.searchApps" ) }
383384 allowClear
384385 onSearch = { value => setSearchText ( value ) }
385386 onChange = { e => setSearchText ( e . target . value ) }
@@ -391,13 +392,13 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
391392 icon = { < FilterOutlined /> }
392393 style = { { marginLeft : '8px' } }
393394 >
394- { showManagedOnly ? 'Show All' : 'Managed Only' }
395+ { showManagedOnly ? trans ( "enterprise.environments.apps.showAll" ) : trans ( "enterprise.environments.apps.managedOnly" ) }
395396 </ Button >
396397 </ div >
397398
398399 { searchText && displayedApps . length !== apps . length && (
399400 < 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 } ) }
401402 </ div >
402403 ) }
403404
@@ -407,7 +408,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
407408 rowKey = "applicationId"
408409 pagination = { {
409410 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 } ) ,
411412 size : 'small'
412413 } }
413414 size = "middle"
0 commit comments