Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf4bca62

Browse files
committed
add more services in trans
1 parentd193eff commitf4bca62

File tree

7 files changed

+93
-36
lines changed

7 files changed

+93
-36
lines changed

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,6 +2829,22 @@ export const en = {
28292829
"inputFieldPlaceholder":"Enter {label}"
28302830
},
28312831

2832+
// Add contact lowcoder modal
2833+
"contactLowcoder":{
2834+
"title":"Contact Lowcoder Team",
2835+
"environmentLabel":"Environment:",
2836+
"environmentIdLabel":"Environment ID:",
2837+
"deploymentIdLabel":"Deployment ID:",
2838+
"loading":"Loading...",
2839+
"notAvailable":"Not available",
2840+
"unnamedEnvironment":"Unnamed Environment",
2841+
"fetchingDeploymentInfo":"Fetching deployment information...",
2842+
"unableToLoadContactForm":"Unable to Load Contact Form",
2843+
"apiConfigurationError":"Environment API service URL or API key not configured",
2844+
"failedToFetchDeploymentId":"Failed to fetch deployment ID",
2845+
"ensureProperConfiguration":"Please ensure the environment is properly configured to contact support."
2846+
},
2847+
28322848
"credentialConfirmations":{
28332849
"firstConfirmation":{
28342850
"title":"Overwrite Credentials Warning",
@@ -2918,6 +2934,36 @@ export const en = {
29182934
"apps":{
29192935
"failedToFetchApps":"Failed to fetch apps",
29202936
"failedToDeployApp":"Failed to deploy app"
2937+
},
2938+
"datasources":{
2939+
"workspaceIdRequired":"Workspace ID is required",
2940+
"apiKeyRequiredToFetchDataSources":"API key is required to fetch data sources",
2941+
"apiServiceUrlRequiredToFetchDataSources":"API service URL is required to fetch data sources",
2942+
"failedToFetchDataSources":"Failed to fetch data sources",
2943+
"failedToDeployDataSource":"Failed to deploy data source"
2944+
},
2945+
"workspace":{
2946+
"failedToFetchWorkspaces":"Failed to fetch workspaces",
2947+
"failedToDeployWorkspace":"Failed to deploy workspace"
2948+
},
2949+
"managedObjects":{
2950+
"missingRequiredParameters":"Missing required parameters",
2951+
"failedToCheckManagedStatus":"Failed to check managed status",
2952+
"failedToSetAsManaged":"Failed to set {{objType}} as managed",
2953+
"failedToRemoveFromManaged":"Failed to remove {{objType}} from managed",
2954+
"missingEnvironmentId":"Missing environment ID",
2955+
"failedToFetchManagedObjects":"Failed to fetch managed objects",
2956+
"failedToFetchManagedObject":"Failed to fetch managed object",
2957+
"managedObjectNotFound":"Managed object not found for objGid: {{objGid}}"
2958+
},
2959+
"license":{
2960+
"apiServiceUrlRequired":"API service URL is required",
2961+
"licenseInformationUnavailable":"License information unavailable",
2962+
"licenseCheckTookTooLong":"License check took too long",
2963+
"licenseServiceNotAvailable":"License service not available",
2964+
"authenticationRequired":"Authentication required - please check API key",
2965+
"licenseServiceTemporarilyUnavailable":"License service temporarily unavailable",
2966+
"remainingAPICalls":"{{remaining}} remaining ({{used}}/{{total}} used, {{percentage}}%)",
29212967
}
29222968
}
29232969
}

‎client/packages/lowcoder/src/pages/setting/environments/components/ContactLowcoderModal.tsx‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
22
import{Modal,Card,Row,Col,Typography,Divider,Spin,Alert}from'antd';
33
import{CustomerServiceOutlined,CloudServerOutlined}from'@ant-design/icons';
44
import{useSelector}from'react-redux';
5+
import{trans}from'i18n';
56
import{Environment}from'../types/environment.types';
67
import{getEnvironmentDeploymentId}from'../services/environments.service';
78
import{HubspotModal}from'../../hubspotModal';
@@ -34,7 +35,7 @@ const ContactLowcoderModal: React.FC<ContactLowcoderModalProps> = ({
3435
constfetchDeploymentId=async()=>{
3536
if(!visible||!environment.environmentApiServiceUrl||!environment.environmentApikey){
3637
if(visible){
37-
setError('Environment API service URL or API key not configured');
38+
setError(trans('enterprise.environments.contactLowcoder.apiConfigurationError'));
3839
}
3940
return;
4041
}
@@ -51,7 +52,7 @@ const ContactLowcoderModal: React.FC<ContactLowcoderModalProps> = ({
5152
setShowHubspotModal(true);
5253
}catch(err){
5354
console.error('Failed to fetch deployment ID:',err);
54-
setError(errinstanceofError ?err.message :'Failed to fetch deployment ID');
55+
setError(errinstanceofError ?err.message :trans('enterprise.environments.contactLowcoder.failedToFetchDeploymentId'));
5556
}finally{
5657
setIsLoading(false);
5758
}
@@ -91,7 +92,7 @@ const ContactLowcoderModal: React.FC<ContactLowcoderModalProps> = ({
9192
title={
9293
<divstyle={{display:'flex',alignItems:'center',gap:'12px'}}>
9394
<CustomerServiceOutlinedstyle={{fontSize:'20px',color:'#1890ff'}}/>
94-
<spanstyle={{fontSize:'18px',fontWeight:600}}>Contact Lowcoder Team</span>
95+
<spanstyle={{fontSize:'18px',fontWeight:600}}>{trans('enterprise.environments.contactLowcoder.title')}</span>
9596
</div>
9697
}
9798
open={visible}
@@ -119,15 +120,15 @@ const ContactLowcoderModal: React.FC<ContactLowcoderModalProps> = ({
119120
<Colflex={1}>
120121
<div>
121122
<Textstrongstyle={{fontSize:'16px',color:'#262626'}}>
122-
Environment:{environment.environmentName||'Unnamed Environment'}
123+
{trans('enterprise.environments.contactLowcoder.environmentLabel')}{environment.environmentName||trans('enterprise.environments.contactLowcoder.unnamedEnvironment')}
123124
</Text>
124125
<br/>
125126
<Textstyle={{fontSize:'14px',color:'#8c8c8c',fontFamily:'monospace'}}>
126-
Environment ID:{environment.environmentId}
127+
{trans('enterprise.environments.contactLowcoder.environmentIdLabel')}{environment.environmentId}
127128
</Text>
128129
<br/>
129130
<Textstyle={{fontSize:'14px',color:'#8c8c8c',fontFamily:'monospace'}}>
130-
Deployment ID:{isLoading ?'Loading...' :deploymentId||'Not available'}
131+
{trans('enterprise.environments.contactLowcoder.deploymentIdLabel')}{isLoading ?trans('enterprise.environments.contactLowcoder.loading') :deploymentId||trans('enterprise.environments.contactLowcoder.notAvailable')}
131132
</Text>
132133
</div>
133134
</Col>
@@ -148,14 +149,14 @@ const ContactLowcoderModal: React.FC<ContactLowcoderModalProps> = ({
148149
}}>
149150
<Spinsize="large"/>
150151
<Textstyle={{marginTop:'16px',color:'#8c8c8c'}}>
151-
Fetching deployment information...
152+
{trans('enterprise.environments.contactLowcoder.fetchingDeploymentInfo')}
152153
</Text>
153154
</div>
154155
)}
155156

156157
{error&&(
157158
<Alert
158-
message="Unable to Load Contact Form"
159+
message={trans('enterprise.environments.contactLowcoder.unableToLoadContactForm')}
159160
description={error}
160161
type="error"
161162
showIcon
@@ -170,7 +171,7 @@ const ContactLowcoderModal: React.FC<ContactLowcoderModalProps> = ({
170171
fontSize:'14px'
171172
}}>
172173
<CustomerServiceOutlinedstyle={{fontSize:'48px',marginBottom:'16px',color:'#d9d9d9'}}/>
173-
<div>Please ensure the environment is properly configured to contact support.</div>
174+
<div>{trans('enterprise.environments.contactLowcoder.ensureProperConfiguration')}</div>
174175
</div>
175176
)}
176177
</div>

‎client/packages/lowcoder/src/pages/setting/environments/services/datasources.service.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// services/dataSources.service.ts
22
importaxiosfrom'axios';
33
import{messageInstance}from"lowcoder-design/src/components/GlobalInstances";
4+
import{trans}from"i18n";
45
import{DataSource,DataSourceWithMeta}from"../types/datasource.types";
56
import{getManagedObjects,ManagedObject,ManagedObjectType,transferManagedObject}from"./managed-objects.service";
67

@@ -32,15 +33,15 @@ export async function getWorkspaceDataSources(
3233
try{
3334
// Check if required parameters are provided
3435
if(!workspaceId){
35-
thrownewError('Workspace ID is required');
36+
thrownewError(trans("enterprise.environments.services.datasources.workspaceIdRequired"));
3637
}
3738

3839
if(!apiKey){
39-
thrownewError('API key is required to fetch data sources');
40+
thrownewError(trans("enterprise.environments.services.datasources.apiKeyRequiredToFetchDataSources"));
4041
}
4142

4243
if(!apiServiceUrl){
43-
thrownewError('API service URL is required to fetch data sources');
44+
thrownewError(trans("enterprise.environments.services.datasources.apiServiceUrlRequiredToFetchDataSources"));
4445
}
4546

4647
// Set up headers with the Bearer token format
@@ -64,7 +65,7 @@ export async function getWorkspaceDataSources(
6465
returnresponse.data.data;
6566
}catch(error){
6667
// Handle and transform error
67-
consterrorMessage=errorinstanceofError ?error.message :'Failed to fetch data sources';
68+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.datasources.failedToFetchDataSources");
6869
messageInstance.error(errorMessage);
6970
throwerror;
7071
}
@@ -143,7 +144,7 @@ export async function getMergedWorkspaceDataSources(
143144
};
144145
}catch(error){
145146
consterrorMessage=
146-
errorinstanceofError ?error.message :"Failed to fetch data sources";
147+
errorinstanceofError ?error.message :trans("enterprise.environments.services.datasources.failedToFetchDataSources");
147148
messageInstance.error(errorMessage);
148149
throwerror;
149150
}
@@ -170,7 +171,7 @@ export async function deployDataSource(params: DeployDataSourceParams): Promise<
170171
}
171172
returnresponse.status===200;
172173
}catch(error){
173-
consterrorMessage=errorinstanceofError ?error.message :'Failed to deploy data source';
174+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.datasources.failedToDeployDataSource");
174175
messageInstance.error(errorMessage);
175176
throwerror;
176177
}

‎client/packages/lowcoder/src/pages/setting/environments/services/license.service.ts‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
importaxiosfrom'axios';
2+
import{trans}from'i18n';
23
import{EnvironmentLicense,DetailedLicenseInfo}from'../types/environment.types';
34

45
/**
@@ -15,7 +16,7 @@ export async function checkEnvironmentLicense(
1516
if(!apiServiceUrl){
1617
return{
1718
isValid:false,
18-
error:'API service URL is required'
19+
error:trans('enterprise.environments.services.license.apiServiceUrlRequired')
1920
};
2021
}
2122

@@ -30,7 +31,7 @@ export async function checkEnvironmentLicense(
3031
`${apiServiceUrl}/api/plugins/enterprise/license`,
3132
{
3233
headers,
33-
timeout:500// Very short timeout for immediate failure when endpoint doesn't exist
34+
timeout:1500// Very short timeout for immediate failure when endpoint doesn't exist
3435
}
3536
);
3637

@@ -65,17 +66,17 @@ export async function checkEnvironmentLicense(
6566

6667
}catch(error){
6768
// Determine the specific error type
68-
leterrorMessage='License information unavailable';
69+
leterrorMessage=trans('enterprise.environments.services.license.licenseInformationUnavailable');
6970

7071
if(axios.isAxiosError(error)){
7172
if(error.code==='ECONNABORTED'){
72-
errorMessage='License check took too long';
73+
errorMessage=trans('enterprise.environments.services.license.licenseCheckTookTooLong');
7374
}elseif(error.response?.status===404){
74-
errorMessage='License service not available';
75+
errorMessage=trans('enterprise.environments.services.license.licenseServiceNotAvailable');
7576
}elseif(error.response?.status===401){
76-
errorMessage='Authentication required - please check API key';
77+
errorMessage=trans('enterprise.environments.services.license.authenticationRequired');
7778
}elseif(error.response&&error.response.status>=500){
78-
errorMessage='License service temporarily unavailable';
79+
errorMessage=trans('enterprise.environments.services.license.licenseServiceTemporarilyUnavailable');
7980
}
8081
}
8182

@@ -96,7 +97,12 @@ export function formatAPICalls(remaining: number, total: number): string {
9697
constused=total-remaining;
9798
constpercentage=total>0 ?Math.round((used/total)*100) :0;
9899

99-
return`${remaining.toLocaleString()} remaining (${used.toLocaleString()}/${total.toLocaleString()} used,${percentage}%)`;
100+
returntrans('enterprise.environments.services.license.remainingAPICalls',{
101+
remaining:remaining.toLocaleString(),
102+
used:used.toLocaleString(),
103+
total:total.toLocaleString(),
104+
percentage
105+
});
100106
}
101107

102108
/**

‎client/packages/lowcoder/src/pages/setting/environments/services/managed-objects.service.ts‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
importaxiosfrom"axios";
22
import{messageInstance}from"lowcoder-design/src/components/GlobalInstances";
3+
import{trans}from"i18n";
34

45
// Object types that can be managed
56
exportenumManagedObjectType{
@@ -32,7 +33,7 @@ export async function isManagedObject(
3233
):Promise<boolean>{
3334
try{
3435
if(!objGid||!environmentId||!objType){
35-
thrownewError("Missing required parameters");
36+
thrownewError(trans("enterprise.environments.services.managedObjects.missingRequiredParameters"));
3637
}
3738

3839
constresponse=awaitaxios.get(`/api/plugins/enterprise/managed-obj`,{
@@ -50,7 +51,7 @@ export async function isManagedObject(
5051
returnfalse;
5152
}
5253

53-
consterrorMessage=errorinstanceofError ?error.message :"Failed to check managed status";
54+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.managedObjects.failedToCheckManagedStatus");
5455
messageInstance.error(errorMessage);
5556
throwerror;
5657
}
@@ -73,7 +74,7 @@ export async function setManagedObject(
7374
):Promise<boolean>{
7475
try{
7576
if(!objGid||!environmentId||!objType){
76-
thrownewError("Missing required parameters");
77+
thrownewError(trans("enterprise.environments.services.managedObjects.missingRequiredParameters"));
7778
}
7879

7980
constrequestBody={
@@ -87,7 +88,7 @@ export async function setManagedObject(
8788

8889
returnresponse.status===200;
8990
}catch(error){
90-
consterrorMessage=errorinstanceofError ?error.message :`Failed to set${objType} as managed`;
91+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.managedObjects.failedToSetAsManaged",{objType});
9192
messageInstance.error(errorMessage);
9293
throwerror;
9394
}
@@ -108,7 +109,7 @@ export async function unsetManagedObject(
108109
):Promise<boolean>{
109110
try{
110111
if(!objGid||!environmentId||!objType){
111-
thrownewError("Missing required parameters");
112+
thrownewError(trans("enterprise.environments.services.managedObjects.missingRequiredParameters"));
112113
}
113114

114115
constresponse=awaitaxios.delete(`/api/plugins/enterprise/managed-obj`,{
@@ -121,7 +122,7 @@ export async function unsetManagedObject(
121122

122123
returnresponse.status===200;
123124
}catch(error){
124-
consterrorMessage=errorinstanceofError ?error.message :`Failed to remove${objType} from managed`;
125+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.managedObjects.failedToRemoveFromManaged",{objType});
125126
messageInstance.error(errorMessage);
126127
throwerror;
127128
}
@@ -134,7 +135,7 @@ export async function getManagedObjects(
134135
):Promise<ManagedObject[]>{
135136
try{
136137
if(!environmentId){
137-
thrownewError("Missing environment ID");
138+
thrownewError(trans("enterprise.environments.services.managedObjects.missingEnvironmentId"));
138139
}
139140

140141
constresponse=awaitaxios.get(`/api/plugins/enterprise/managed-obj/list`,{
@@ -146,7 +147,7 @@ export async function getManagedObjects(
146147

147148
returnresponse.data.data;
148149
}catch(error){
149-
consterrorMessage=errorinstanceofError ?error.message :"Failed to fetch managed objects";
150+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.managedObjects.failedToFetchManagedObjects");
150151
messageInstance.error(errorMessage);
151152
throwerror;
152153
}
@@ -166,7 +167,7 @@ export async function getSingleManagedObject(
166167
):Promise<ManagedObject|null>{
167168
try{
168169
if(!objGid||!environmentId||!objType){
169-
thrownewError("Missing required parameters");
170+
thrownewError(trans("enterprise.environments.services.managedObjects.missingRequiredParameters"));
170171
}
171172

172173
constresponse=awaitaxios.get(`/api/plugins/enterprise/managed-obj`,{
@@ -184,7 +185,7 @@ export async function getSingleManagedObject(
184185
returnnull;
185186
}
186187

187-
consterrorMessage=errorinstanceofError ?error.message :"Failed to fetch managed object";
188+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.managedObjects.failedToFetchManagedObject");
188189
messageInstance.error(errorMessage);
189190
throwerror;
190191
}
@@ -197,7 +198,7 @@ export async function transferManagedObject(objGid: string, sourceEnvId: string,
197198
if(managedObject){
198199
awaitsetManagedObject(managedObject.objGid,targetEnvId,objType,managedObject.managedId);
199200
}else{
200-
thrownewError(`Managed object not found forobjGid:${objGid}`);
201+
thrownewError(trans("enterprise.environments.services.managedObjects.managedObjectNotFound",{objGid}));
201202
}
202203
}catch(error){
203204
console.error('Error transferring managed object:',error);

‎client/packages/lowcoder/src/pages/setting/environments/services/query.service.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Get merged queries (both regular and managed) for a workspace
33
*/
44
importaxiosfrom'axios';
5+
import{trans}from'i18n';
56
import{getManagedObjects,ManagedObjectType,transferManagedObject}from'./managed-objects.service';
67
import{getWorkspaceQueries}from'./environments.service';
78
import{Query,QueryStats}from'../types/query.types';

‎client/packages/lowcoder/src/pages/setting/environments/services/workspace.service.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// services/workspacesService.ts (or wherever makes sense in your structure)
22
import{messageInstance}from"lowcoder-design/src/components/GlobalInstances";
3+
import{trans}from"i18n";
34
import{getEnvironmentWorkspaces}from"./environments.service";
45
import{getManagedObjects,ManagedObject,ManagedObjectType,transferManagedObject}from"./managed-objects.service";
56
import{Workspace}from"../types/workspace.types";
@@ -69,7 +70,7 @@ export async function getMergedEnvironmentWorkspaces(
6970
}
7071
};
7172
}catch(error){
72-
consterrorMessage=errorinstanceofError ?error.message :"Failed to fetch workspaces";
73+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.workspace.failedToFetchWorkspaces");
7374
messageInstance.error(errorMessage);
7475
throwerror;
7576
}
@@ -107,7 +108,7 @@ export async function deployWorkspace(params: {
107108

108109
returnresponse.status===200;
109110
}catch(error){
110-
consterrorMessage=errorinstanceofError ?error.message :'Failed to deployworkspace';
111+
consterrorMessage=errorinstanceofError ?error.message :trans("enterprise.environments.services.workspace.failedToDeployWorkspace");
111112
// Don't show message directly, let the calling component handle it
112113
thrownewError(errorMessage);
113114
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp