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

Commit7251c1e

Browse files
committed
revert language of lowcoder and lowcoder-design
1 parentd4140ae commit7251c1e

File tree

5 files changed

+27
-56
lines changed

5 files changed

+27
-56
lines changed
Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
import{getI18nObjects,Translator}from"lowcoder-core";
1+
import{Translator}from"lowcoder-core";
22
import*aslocaleDatafrom"./locales";
3-
import{ReactNode}from"react";
43

5-
typetransType=(key:any,variables?:any)=>string;
6-
typetransToNodeType=(key:any,variables?:any)=>ReactNode;
7-
8-
lettrans:transType;
9-
lettransToNode:transToNodeType;
10-
letlanguage='en';
11-
12-
exportconstinitTranslator=async(lang?:string)=>{
13-
letlangJson=await(localeDataasany)[lang||'en']();
14-
langJson={[lang||'en']:langJson}
15-
consttranslator=newTranslator<typeoflangJson>(
16-
langJson,
17-
REACT_APP_LANGUAGES,
18-
[lang||'en']
19-
);
20-
21-
language=translator.language;
22-
transToNode=(key:any,variables?:any)=>translator.transToNode?.(key,variables);
23-
trans=(key:any,variables?:any)=>translator.trans?.(key,variables);
24-
}
25-
26-
constlangJson=await(localeDataasany)[REACT_APP_LANGUAGES||'en']();
27-
28-
awaitinitTranslator();
29-
30-
export{language,trans,transToNode};
4+
exportconst{ trans}=newTranslator<typeoflocaleData.en>(localeData,REACT_APP_LANGUAGES);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// file examples: en, enGB, zh, zhHK
22
// fallback example: current locale is zh-HK, fallback order is zhHK => zh => en
3-
exportconsten=async() :Promise<Object>=>awaitimport("./en").then(module=>module.en);
4-
exportconstzh=async() :Promise<Object>=>awaitimport("./zh").then(module=>module.zh);
5-
exportconstde=async() :Promise<Object>=>awaitimport("./de").then(module=>module.de);
6-
exportconstpt=async() :Promise<Object>=>awaitimport("./pt").then(module=>module.pt);
3+
export*from"./en";
4+
export*from"./zh";
5+
export*from"./de";
6+
export*from"./pt"

‎client/packages/lowcoder-design/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target":"es2017",
3+
"target":"es5",
44
"experimentalDecorators":true,
55
"lib": ["dom","dom.iterable","esnext"],
66
"allowJs":true,

‎client/packages/lowcoder/src/i18n/index.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,26 @@ let trans: transType;
1111
lettransToNode:transToNodeType;
1212
letlanguage='en';
1313

14-
exportconstinitTranslator=async(lang?:string)=>{
15-
letlangJson=await(localeDataasany)[lang||'en']();
16-
langJson={[lang||'en']:langJson}
17-
consttranslator=newTranslator<typeoflangJson>(
18-
langJson,
19-
REACT_APP_LANGUAGES,
20-
[lang||'en']
14+
exportconstinitTranslator=(lang?:string)=>{
15+
consttranslator=newTranslator<typeoflocaleData.en>(
16+
localeData,
17+
REACT_APP_LANGUAGES,
18+
[lang||'en']
2119
);
2220

2321
language=translator.language;
24-
transToNode=(key:any,variables?:any)=>translator.transToNode?.(key,variables);
25-
trans=(key:any,variables?:any)=>translator.trans?.(key,variables);
22+
transToNode=translator.transToNode;
23+
trans=translator.trans;
2624
}
2725

28-
constlangJson=await(localeDataasany)[REACT_APP_LANGUAGES||'en']();
29-
exportconsti18nObjs=getI18nObjects<I18nObjects>(langJson,REACT_APP_LANGUAGES||'en');
26+
exportconsti18nObjs=getI18nObjects<I18nObjects>(localeData,REACT_APP_LANGUAGES);
3027

3128
exportconstlanguageList=Object.keys(languagesMetadata).map(code=>({
3229
languageCode:code,
3330
languageName:languagesMetadata[code].languageName,
3431
flag:languagesMetadata[code].flag
3532
}));
3633

37-
awaitinitTranslator();
34+
initTranslator();
3835

3936
export{language,trans,transToNode};
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// file examples: en, enGB, zh, zhHK
22
// fallback example: current locale is zh-HK, fallback order is zhHK => zh => en
3-
exportconstde=async():Promise<object>=>awaitimport("./de").then(module=>(module.de));
4-
exportconsten=async():Promise<object>=>awaitimport("./en").then(module=>(module.en));
5-
exportconstit=async():Promise<object>=>awaitimport("./it").then(module=>(module.it));
6-
exportconstpt=async():Promise<object>=>awaitimport("./pt").then(module=>(module.pt));
7-
exportconstes=async():Promise<object>=>awaitimport("./es").then(module=>(module.es));
8-
exportconstzh=async():Promise<object>=>awaitimport("./zh").then(module=>(module.zh));
9-
exportconstru=async():Promise<object>=>awaitimport("./ru").then(module=>(module.ru));
3+
export*from"./de";
4+
export*from"./en";
5+
export*from"./it";
6+
export*from"./pt";
7+
export*from"./es";
8+
export*from"./zh";
9+
export*from"./ru";
1010

11-
exportconstenObj=async():Promise<object>=>awaitimport("./enObj").then(module=>(module.enObj));
12-
exportconstdeObj=async():Promise<object|undefined>=>awaitimport("./deObj").then(module=>(module.deObj));
13-
exportconstitObj=async():Promise<object>=>awaitimport("./itObj").then(module=>(module.itObj));
14-
exportconstzhObj=async():Promise<object|undefined>=>awaitimport("./zhObj").then(module=>(module.zhObj));
11+
export*from"./enObj";
12+
export*from"./deObj";
13+
export*from"./itObj";
14+
export*from"./zhObj";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp