File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed
client/packages/lowcoder/src Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ import { BoolControl } from "../../controls/boolControl";
3
3
import { ArrowControl , BoolCodeControl , MaskControl } from "../../controls/codeControl" ;
4
4
import { Section } from "lowcoder-design" ;
5
5
import { TourStepControl } from "@lowcoder-ee/comps/controls/tourStepControl" ;
6
- import { booleanExposingStateControl , dropdownControl } from "lowcoder-sdk" ;
6
+ import { booleanExposingStateControl } from "comps/controls/codeStateControl" ;
7
+ import { dropdownControl } from "comps/controls/dropdownControl" ;
7
8
import { trans } from "i18n" ;
8
9
import { PlacementOptions , TypeOptions } from "@lowcoder-ee/comps/comps/tourComp/tourControlConstants" ;
9
10
import {
Original file line number Diff line number Diff line change 1
1
import { getI18nObjects , Translator } from "lowcoder-core" ;
2
2
import * as localeData from "./locales" ;
3
3
import { I18nObjects } from "./locales/types" ;
4
+ import { languagesMetadata } from "./languagesMeta" ; // Import the metadata
4
5
5
6
export const { trans, transToNode, language } = new Translator < typeof localeData . en > (
6
7
localeData ,
7
8
REACT_APP_LANGUAGES ,
8
9
[ 'de' ]
9
10
) ;
10
11
export const i18nObjs = getI18nObjects < I18nObjects > ( localeData , REACT_APP_LANGUAGES ) ;
12
+
13
+ export const languageList = Object . keys ( languagesMetadata ) . map ( code => ( {
14
+ languageCode : code ,
15
+ languageName : languagesMetadata [ code ] . languageName ,
16
+ flag : languagesMetadata [ code ] . flag
17
+ } ) ) ;
Original file line number Diff line number Diff line change
1
+ // Define the structure for a single language's metadata
2
+ export interface LanguageMeta {
3
+ languageName : string ;
4
+ flag : string ;
5
+ }
6
+
7
+ // Define the structure for the container of all language metadatas
8
+ export interface LanguagesMetadata {
9
+ [ key : string ] : LanguageMeta ;
10
+ }
11
+
12
+ // Example metadata object
13
+ export const languagesMetadata : LanguagesMetadata = {
14
+ en : {
15
+ languageName : "English" ,
16
+ flag : "/flags/en.png"
17
+ } ,
18
+ de : {
19
+ languageName : "Deutsch" ,
20
+ flag : "/flags/de.png"
21
+ } ,
22
+ it : {
23
+ languageName : "Italiano" ,
24
+ flag : "/flags/it.png"
25
+ } ,
26
+ zh : {
27
+ languageName : "中文" ,
28
+ flag : "/flags/zh.png"
29
+ }
30
+ } ;
31
+
You can’t perform that action at this time.
0 commit comments