Skip to content

Commit e920c68

Browse files
committed
Add trans for Create Env Modal
1 parent b7ee9c6 commit e920c68

File tree

2 files changed

+112
-31
lines changed

2 files changed

+112
-31
lines changed

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

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,7 @@ export const en = {
24992499
"API100k": "100,000 API Calls — $100",
25002500
"API1M": "1,000,000 API Calls — $1,000",
25012501
"API10M": "10,000,000 API Calls — $10,000",
2502-
"UsageOverrunDesc": "When your API package runs low, well alert you. Once the package is consumed, your instance remains functional but will operate at a reduced speed to prevent abuse and maintain fairness.",
2502+
"UsageOverrunDesc": "When your API package runs low, we'll alert you. Once the package is consumed, your instance remains functional but will operate at a reduced speed to prevent abuse and maintain fairness.",
25032503
"UsageTopUpInfo": "You can seamlessly add additional packages anytime to ensure continuous, fast access — no service interruptions.",
25042504
"AppUsageTitle": "App Usage Logs",
25052505
"AppUsageIntroTitle": "Understand how your apps are used",
@@ -2531,7 +2531,7 @@ export const en = {
25312531
"BrandingPagesIntro2": "These touchpoints help deliver a fully branded experience even during unexpected scenarios or account transitions.",
25322532
"BrandingMetaIntro": "Define standard metadata like page title and description to improve your SEO presence and brand messaging.",
25332533
"BrandingHelpLinksIntro": "Add context-sensitive documentation links directly inside the app, providing just-in-time help to your users.",
2534-
"BrandingWhatsNewIntro": "Activate the 'Whats New' section to highlight updates and product announcements in a branded and visible manner.",
2534+
"BrandingWhatsNewIntro": "Activate the 'What's New' section to highlight updates and product announcements in a branded and visible manner.",
25352535

25362536
"EnvironmentsIntroTitle": "Lowcoder Staging",
25372537
"EnvironmentsTitle" : "Multi-Environment Infrastructure",
@@ -2582,6 +2582,86 @@ export const en = {
25822582
"unlicensed": "License Required",
25832583
"error": "Setup Required",
25842584
"unknown": "Unknown"
2585+
},
2586+
"detail": {
2587+
"environmentNotFound": "Environment Not Found",
2588+
"returnToEnvironmentsList": "Return to Environments List",
2589+
"environmentDetail": "Environment Detail",
2590+
"environmentOverview": "Environment Overview",
2591+
"noDomainSet": "No domain set",
2592+
"environmentId": "Environment ID",
2593+
"licenseStatus": "License Status",
2594+
"licenseNeeded": "License Needed",
2595+
"setupRequired": "Setup Required",
2596+
"created": "Created",
2597+
"unknown": "Unknown",
2598+
"licenseDetails": "License Details",
2599+
"apiCallsRemaining": "API Calls Remaining",
2600+
"totalApiCallsLimit": "Total API Calls Limit",
2601+
"enterpriseEdition": "Enterprise Edition",
2602+
"active": "Active",
2603+
"inactive": "Inactive",
2604+
"licenseInformation": "License Information",
2605+
"calls": "calls",
2606+
"licenses": "Licenses",
2607+
"license": "License",
2608+
"workspaces": "Workspaces",
2609+
"userGroups": "User Groups",
2610+
"type": "Type",
2611+
"status": "Status",
2612+
"licensed": "Licensed",
2613+
"unlicensed": "Unlicensed",
2614+
"apiKey": "API Key",
2615+
"configured": "Configured",
2616+
"notSet": "Not Set",
2617+
"masterEnv": "Master Env"
2618+
},
2619+
"unlicensed": {
2620+
"unlicensedDescription": "This environment needs a valid license to unlock its full capabilities and features. Please make sure your API Service URL is correctly configured and Plugin is installed.",
2621+
"errorDescription": "We encountered an issue while checking the license. Please review the configuration settings.",
2622+
"defaultDescription": "This environment requires license configuration to proceed.",
2623+
"contactLowcoderTeam": "Contact Lowcoder Team",
2624+
"editEnvironment": "Edit Environment",
2625+
"backToEnvironments": "Back to Environments",
2626+
"helpText": "Need assistance? Contact our team for licensing support or edit the environment configuration to resolve this issue.",
2627+
"type": "Type",
2628+
"status": "Status",
2629+
"masterEnv": "Master Env",
2630+
"licenseIssue": "License Issue",
2631+
"error": "Error",
2632+
"missing": "Missing"
2633+
},
2634+
"error": {
2635+
"itemNotFound": "The item you're looking for doesn't exist or you don't have permission to view it."
2636+
},
2637+
"modal": {
2638+
"createNewEnvironment": "Create New Environment",
2639+
"cancel": "Cancel",
2640+
"createEnvironment": "Create Environment",
2641+
"environmentName": "Environment Name",
2642+
"pleaseEnterName": "Please enter a name",
2643+
"nameMinLength": "Name must be at least 2 characters",
2644+
"enterEnvironmentName": "Enter environment name",
2645+
"description": "Description",
2646+
"enterDescription": "Enter description",
2647+
"stage": "Stage",
2648+
"pleaseSelectStage": "Please select a stage",
2649+
"selectStage": "Select stage",
2650+
"development": "Development (DEV)",
2651+
"testing": "Testing (TEST)",
2652+
"preProduction": "Pre-Production (PREPROD)",
2653+
"production": "Production (PROD)",
2654+
"frontendUrl": "Frontend URL",
2655+
"pleaseEnterValidUrl": "Please enter a valid URL",
2656+
"apiServiceUrl": "API Service URL",
2657+
"nodeServiceUrl": "Node Service URL",
2658+
"apiKey": "API Key",
2659+
"enterApiKey": "Enter API key",
2660+
"masterEnvironment": "Master Environment",
2661+
"alreadyMasterEnvironment": "{name} is already the Master environment",
2662+
"willBeMaster": "Will be Master",
2663+
"configurationRequirements": "Configuration Requirements",
2664+
"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."
25852665
}
25862666
}
25872667
},

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

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Modal, Form, Input, Select, Switch, Button, Alert, Tooltip } from 'antd
33
import { useSelector } from 'react-redux';
44
import { selectMasterEnvironment, selectHasMasterEnvironment } from 'redux/selectors/enterpriseSelectors';
55
import { Environment } from '../types/environment.types';
6+
import { trans } from 'i18n';
67

78
const { Option } = Select;
89

@@ -66,22 +67,22 @@ const CreateEnvironmentModal: React.FC<CreateEnvironmentModalProps> = ({
6667

6768
return (
6869
<Modal
69-
title="Create New Environment"
70+
title={trans("enterprise.environments.modal.createNewEnvironment")}
7071
open={visible}
7172
onCancel={handleCancel}
7273
maskClosable={true}
7374
destroyOnHidden={true}
7475
footer={[
7576
<Button key="back" onClick={handleCancel}>
76-
Cancel
77+
{trans("enterprise.environments.modal.cancel")}
7778
</Button>,
7879
<Button
7980
key="submit"
8081
type="primary"
8182
loading={loading || submitLoading}
8283
onClick={handleSubmit}
8384
>
84-
Create Environment
85+
{trans("enterprise.environments.modal.createEnvironment")}
8586
</Button>
8687
]}
8788
>
@@ -95,84 +96,84 @@ const CreateEnvironmentModal: React.FC<CreateEnvironmentModalProps> = ({
9596
>
9697
<Form.Item
9798
name="environmentName"
98-
label="Environment Name"
99+
label={trans("enterprise.environments.modal.environmentName")}
99100
rules={[
100-
{ required: true, message: 'Please enter a name' },
101-
{ min: 2, message: 'Name must be at least 2 characters' }
101+
{ required: true, message: trans("enterprise.environments.modal.pleaseEnterName") },
102+
{ min: 2, message: trans("enterprise.environments.modal.nameMinLength") }
102103
]}
103104
>
104-
<Input placeholder="Enter environment name" />
105+
<Input placeholder={trans("enterprise.environments.modal.enterEnvironmentName")} />
105106
</Form.Item>
106107

107108
<Form.Item
108109
name="environmentDescription"
109-
label="Description"
110+
label={trans("enterprise.environments.modal.description")}
110111
>
111112
<Input.TextArea
112-
placeholder="Enter description"
113+
placeholder={trans("enterprise.environments.modal.enterDescription")}
113114
rows={3}
114115
/>
115116
</Form.Item>
116117

117118
<Form.Item
118119
name="environmentType"
119-
label="Stage"
120-
rules={[{ required: true, message: 'Please select a stage' }]}
120+
label={trans("enterprise.environments.modal.stage")}
121+
rules={[{ required: true, message: trans("enterprise.environments.modal.pleaseSelectStage") }]}
121122
>
122-
<Select placeholder="Select stage">
123-
<Option value="DEV">Development (DEV)</Option>
124-
<Option value="TEST">Testing (TEST)</Option>
125-
<Option value="PREPROD">Pre-Production (PREPROD)</Option>
126-
<Option value="PROD">Production (PROD)</Option>
123+
<Select placeholder={trans("enterprise.environments.modal.selectStage")}>
124+
<Option value="DEV">{trans("enterprise.environments.modal.development")}</Option>
125+
<Option value="TEST">{trans("enterprise.environments.modal.testing")}</Option>
126+
<Option value="PREPROD">{trans("enterprise.environments.modal.preProduction")}</Option>
127+
<Option value="PROD">{trans("enterprise.environments.modal.production")}</Option>
127128
</Select>
128129
</Form.Item>
129130

130131
<Form.Item
131132
name="environmentFrontendUrl"
132-
label="Frontend URL"
133+
label={trans("enterprise.environments.modal.frontendUrl")}
133134
rules={[
134-
{ type: 'url', message: 'Please enter a valid URL' }
135+
{ type: 'url', message: trans("enterprise.environments.modal.pleaseEnterValidUrl") }
135136
]}
136137
>
137138
<Input placeholder="https://example.com" />
138139
</Form.Item>
139140

140141
<Form.Item
141142
name="environmentApiServiceUrl"
142-
label="API Service URL"
143+
label={trans("enterprise.environments.modal.apiServiceUrl")}
143144
rules={[
144-
{ type: 'url', message: 'Please enter a valid URL' }
145+
{ type: 'url', message: trans("enterprise.environments.modal.pleaseEnterValidUrl") }
145146
]}
146147
>
147148
<Input placeholder="https://api.example.com" />
148149
</Form.Item>
149150

150151
<Form.Item
151152
name="environmentNodeServiceUrl"
152-
label="Node Service URL"
153+
label={trans("enterprise.environments.modal.nodeServiceUrl")}
153154
rules={[
154-
{ type: 'url', message: 'Please enter a valid URL' }
155+
{ type: 'url', message: trans("enterprise.environments.modal.pleaseEnterValidUrl") }
155156
]}
156157
>
157158
<Input placeholder="https://node.example.com" />
158159
</Form.Item>
159160

160161
<Form.Item
161162
name="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")}
166167
rows={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
173174
title={
174175
hasMasterEnvironment
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 CreateEnvironmentModal: React.FC<CreateEnvironmentModalProps> = ({
185186
</Tooltip>
186187
{isMaster && (
187188
<span style={{ color: '#52c41a', fontSize: '12px' }}>
188-
Will be Master
189+
{trans("enterprise.environments.modal.willBeMaster")}
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")}
197198
type="warning"
198199
showIcon
199200
style={{ marginTop: '16px' }}

0 commit comments

Comments
 (0)