@@ -3,6 +3,7 @@ import { Modal, Form, Input, Select, Switch, Button, Alert, Tooltip } from 'antd
33import { useSelector } from 'react-redux' ;
44import { selectMasterEnvironment , selectHasMasterEnvironment } from 'redux/selectors/enterpriseSelectors' ;
55import { Environment } from '../types/environment.types' ;
6+ import { trans } from 'i18n' ;
67
78const { Option} = Select ;
89
@@ -81,22 +82,22 @@ const EditEnvironmentModal: React.FC<EditEnvironmentModalProps> = ({
8182
8283return (
8384< Modal
84- title = "Edit Environment"
85+ title = { trans ( "enterprise.environments.modal.editEnvironment" ) }
8586open = { visible }
8687onCancel = { onClose }
8788maskClosable = { true }
8889destroyOnHidden = { true }
8990footer = { [
9091< Button key = "back" onClick = { onClose } >
91- Cancel
92+ { trans ( "enterprise.environments.modal.cancel" ) }
9293</ Button > ,
9394< Button
9495key = "submit"
9596type = "primary"
9697loading = { loading || submitLoading }
9798onClick = { handleSubmit }
9899>
99- Save Changes
100+ { trans ( "enterprise.environments.modal.saveChanges" ) }
100101</ Button >
101102] }
102103>
@@ -107,72 +108,72 @@ const EditEnvironmentModal: React.FC<EditEnvironmentModalProps> = ({
107108>
108109< Form . Item
109110name = "environmentName"
110- label = "Environment Name"
111- rules = { [ { required :true , message :'Please enter a name' } ] }
111+ label = { trans ( "enterprise.environments.modal.environmentName" ) }
112+ rules = { [ { required :true , message :trans ( "enterprise.environments.modal.pleaseEnterName" ) } ] }
112113>
113- < Input placeholder = "Enter environment name" />
114+ < Input placeholder = { trans ( "enterprise.environments.modal.enterEnvironmentName" ) } />
114115</ Form . Item >
115116
116117< Form . Item
117118name = "environmentDescription"
118- label = "Description"
119+ label = { trans ( "enterprise.environments.modal.description" ) }
119120>
120121< Input . TextArea
121- placeholder = "Enter description"
122+ placeholder = { trans ( "enterprise.environments.modal.enterDescription" ) }
122123rows = { 3 }
123124/>
124125</ Form . Item >
125126
126127< Form . Item
127128name = "environmentType"
128- label = "Stage"
129- rules = { [ { required :true , message :'Please select a stage' } ] }
129+ label = { trans ( "enterprise.environments.modal.stage" ) }
130+ rules = { [ { required :true , message :trans ( "enterprise.environments.modal.pleaseSelectStage" ) } ] }
130131>
131- < Select placeholder = "Select stage" >
132- < Option value = "DEV" > Development (DEV) </ Option >
133- < Option value = "TEST" > Testing (TEST) </ Option >
134- < Option value = "PREPROD" > Pre-Production (PREPROD) </ Option >
135- < Option value = "PROD" > Production (PROD) </ Option >
132+ < Select placeholder = { trans ( "enterprise.environments.modal.selectStage" ) } >
133+ < Option value = "DEV" > { trans ( "enterprise.environments.modal.development" ) } </ Option >
134+ < Option value = "TEST" > { trans ( "enterprise.environments.modal.testing" ) } </ Option >
135+ < Option value = "PREPROD" > { trans ( "enterprise.environments.modal.preProduction" ) } </ Option >
136+ < Option value = "PROD" > { trans ( "enterprise.environments.modal.production" ) } </ Option >
136137</ Select >
137138</ Form . Item >
138139
139140< Form . Item
140141name = "environmentFrontendUrl"
141- label = "Frontend URL"
142+ label = { trans ( "enterprise.environments.modal.frontendUrl" ) }
142143>
143144< Input placeholder = "https://example.com" />
144145</ Form . Item >
145146
146147< Form . Item
147148name = "environmentApiServiceUrl"
148- label = "API Service URL"
149+ label = { trans ( "enterprise.environments.modal.apiServiceUrl" ) }
149150>
150151< Input placeholder = "https://api.example.com" />
151152</ Form . Item >
152153
153154< Form . Item
154155name = "environmentNodeServiceUrl"
155- label = "Node Service URL"
156+ label = { trans ( "enterprise.environments.modal.nodeServiceUrl" ) }
156157>
157158< Input placeholder = "https://node.example.com" />
158159</ Form . Item >
159160
160161< Form . Item
161162name = "environmentApikey"
162- label = "API Key"
163+ label = { trans ( "enterprise.environments.modal.apiKey" ) }
163164>
164165< Input . TextArea
165- placeholder = "Enter API key"
166+ placeholder = { trans ( "enterprise.environments.modal.enterApiKey" ) }
166167rows = { 2 }
167168/>
168169</ Form . Item >
169170
170- < Form . Item label = "Master Environment" >
171+ < Form . Item label = { trans ( "enterprise.environments.modal.masterEnvironment" ) } >
171172< div style = { { display :'flex' , alignItems :'center' , gap :'12px' } } >
172173< Tooltip
173174title = {
174175hasOtherMaster && ! isMaster
175- ?` ${ masterEnvironment ?. environmentName } is already the Master environment`
176+ ?trans ( "enterprise.environments.modal.alreadyMasterEnvironment" , { name : masterEnvironment ?. environmentName } )
176177 :''
177178}
178179>
@@ -185,15 +186,15 @@ const EditEnvironmentModal: React.FC<EditEnvironmentModalProps> = ({
185186</ Tooltip >
186187{ isMaster && (
187188< span style = { { color :'#faad14' , fontSize :'12px' } } >
188- Currently Master
189+ { trans ( "enterprise.environments.modal.currentlyMaster" ) }
189190</ span >
190191) }
191192</ div >
192193</ Form . Item >
193194
194195< Alert
195- message = "Configuration Requirements"
196- description = "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."
196+ message = { trans ( "enterprise.environments.modal.configurationRequirements" ) }
197+ description = { trans ( "enterprise.environments.modal.configurationRequirementsDesc" ) }
197198type = "warning"
198199showIcon
199200style = { { marginTop :'16px' } }