GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add createIntl to common.utils, and fix misuse of zh_CN · skyformat99/lowcode-engine@84e0c1f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • deploy-space/static
    • index.html
    • preview.html
  • modules/code-generator
    • src/plugins/project
      • i18n.ts
    • tests
      • bugfix
        • i18n-with-params.schema.json
        • tolerate-eval-errors-1-loop.schema.json
        • tolerate-eval-errors-2-nested-loop.schema.json
      • fixtures/test-cases
        • rax-app
          • demo01/expected/demo-project/src
            • i18n.js
          • demo02/expected/demo-project/src
            • i18n.js
          • demo03/expected/demo-project/src
            • i18n.js
          • demo04/expected/demo-project/src
            • i18n.js
          • demo05/expected/demo-project/src
            • i18n.js
          • demo06-jsslot/expected/demo-project/src
            • i18n.js
          • demo07-newline-in-props/expected/demo-project/src
            • i18n.js
          • demo08-jsslot-with-multiple-children/expected/demo-project/src
            • i18n.js
          • demo09-jsslot-with-conditional-children/expected/demo-project/src
            • i18n.js
          • demo10-jsslot-with-loop-children/expected/demo-project/src
            • i18n.js
          • demo11-utils-name-alias/expected/demo-project/src
            • i18n.js
          • demo12-refs/expected/demo-project/src
            • i18n.js
          • demo13-datasource-prop/expected/demo-project/src
            • i18n.js
        • react-app
          • demo1/expected/demo-project/src
            • i18n.js
          • demo2-utils-name-alias/expected/demo-project/src
            • i18n.js
          • demo2/expected/demo-project/src
            • i18n.js
          • demo3/expected/demo-project/src
            • i18n.js
          • demo4/expected/demo-project/src
            • i18n.js
          • demo5/expected/demo-project/src
            • i18n.js
          • demo6-literal-condition/expected/demo-project/src
            • i18n.js
          • demo7-literal-condition2/expected/demo-project/src
            • i18n.js
          • demo8-datasource-prop/expected/demo-project/src
            • i18n.js
          • demo9-datasource-engine/expected/demo-project/src
            • i18n.js
          • demo_10-jsslot/expected/demo-project/src
            • i18n.js
          • demo_11-jsslot-2/expected/demo-project/src
            • i18n.js
  • packages
    • designer
      • src/locale
        • index.ts
      • tests
        • document/document-model/__snapshots__
          • document-model.test.ts.snap
        • fixtures/schema
          • form-with-modal.ts
          • form.ts
    • editor-core/src
      • config.ts
      • intl
        • index.ts
    • editor-skeleton/src/locale
      • index.ts
    • engine/src/modules
      • utils.ts
    • plugin-outline-pane/src/locale
      • index.ts
    • react-simulator-renderer/test/schema
      • basic.ts
    • renderer-core/src/renderer
      • base.tsx
    • utils/src
      • misc.ts
  • specs
    • material-spec.md

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deploy-space/static/index.html‎

Copy file name to clipboardExpand all lines: deploy-space/static/index.html
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<script>
2222
window.pageConfig = {
2323
env: 'release',
24-
locale: 'zh_CN',
24+
locale: 'zh-CN',
2525
pageType: 'single',
2626
deviceType: 'web',
2727
appName: '基础包管理后台',
@@ -34,7 +34,7 @@
3434
isSuperAdmin: 'n',
3535
isBetaDeveloper: 'n',
3636
formType: 'display',
37-
title: { en_US: '测试', type: 'i18n', zh_CN: '测试' },
37+
title: { 'en-US': 'Test', type: 'i18n', 'zh-CN': '测试' },
3838
urlPrefix: 'https://go.alibaba-inc.com',
3939
APIUrlPrefix: 'https://mocks.alibaba-inc.com/mock/lowCodeEngine',
4040
devVersion: '0.1.0', // 这个是子应用的变更 id
@@ -54,7 +54,7 @@
5454
},
5555
designerConfigs: {},
5656
navConfig:
57-
'{"appName":{"en_US":"基础包管理后台","key":"","type":"i18n","zh_CN":"基础包管理后台"},"bgColor":"white","data":[{"children":[],"hidden":false,"icon":"","inner":true,"navUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","relateUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","slug":"test","targetNew":false,"title":{"en_US":"测试","type":"i18n","zh_CN":"测试"}}],"isFixed":"y","isFold":"y","isFoldHorizontal":"n","languageChangeUrl":{"en_US":"/common/account/changeAccountLanguage.json","type":"i18n","zh_CN":"/common/account/changeAccountLanguage.json"},"layout":"auto","navStyle":"orange","navTheme":"light","openSubMode":false,"showAppTitle":true,"showCrumb":true,"showIcon":false,"showLanguageChange":true,"showNav":true,"showSearch":"n","singletons":{"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V":{"isFixed":"n","isFold":"n","isFoldHorizontal":"n","showAppTitle":false,"showCrumb":false,"showLanguageChange":false,"showNav":false,"showSearch":"n","singleton":false},"test":{"$ref":"$.singletons.FORM\\-3KYJN7RV\\-DIOD8LLK1WGQ89S7NHA92\\-QJVH497K\\-V"}},"type":"top_fold"}',
57+
'{"appName":{"en-US":"基础包管理后台","key":"","type":"i18n","zh-CN":"基础包管理后台"},"bgColor":"white","data":[{"children":[],"hidden":false,"icon":"","inner":true,"navUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","relateUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","slug":"test","targetNew":false,"title":{"en-US":"测试","type":"i18n","zh-CN":"测试"}}],"isFixed":"y","isFold":"y","isFoldHorizontal":"n","languageChangeUrl":{"en-US":"/common/account/changeAccountLanguage.json","type":"i18n","zh-CN":"/common/account/changeAccountLanguage.json"},"layout":"auto","navStyle":"orange","navTheme":"light","openSubMode":false,"showAppTitle":true,"showCrumb":true,"showIcon":false,"showLanguageChange":true,"showNav":true,"showSearch":"n","singletons":{"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V":{"isFixed":"n","isFold":"n","isFoldHorizontal":"n","showAppTitle":false,"showCrumb":false,"showLanguageChange":false,"showNav":false,"showSearch":"n","singleton":false},"test":{"$ref":"$.singletons.FORM\\-3KYJN7RV\\-DIOD8LLK1WGQ89S7NHA92\\-QJVH497K\\-V"}},"type":"top_fold"}',
5858
historyType: 'HASH',
5959
isSinglePage: 'n',
6060
rhino: 'n',
Collapse file

‎deploy-space/static/preview.html‎

Copy file name to clipboardExpand all lines: deploy-space/static/preview.html
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<script>
2424
window.pageConfig = {
2525
env: 'release',
26-
locale: 'zh_CN',
26+
locale: 'zh-CN',
2727
pageType: 'single',
2828
deviceType: 'web',
2929
appName: '基础包管理后台',
@@ -36,7 +36,7 @@
3636
isSuperAdmin: 'n',
3737
isBetaDeveloper: 'n',
3838
formType: 'display',
39-
title: { en_US: '测试', type: 'i18n', zh_CN: '测试' },
39+
title: { 'en-US': 'Test', type: 'i18n', 'zh-CN': '测试' },
4040
urlPrefix: 'https://go.alibaba-inc.com',
4141
APIUrlPrefix: 'https://mocks.alibaba-inc.com/mock/lowCodeEngine',
4242
devVersion: '0.1.0', // 这个是子应用的变更 id
@@ -56,7 +56,7 @@
5656
},
5757
designerConfigs: {},
5858
navConfig:
59-
'{"appName":{"en_US":"基础包管理后台","key":"","type":"i18n","zh_CN":"基础包管理后台"},"bgColor":"white","data":[{"children":[],"hidden":false,"icon":"","inner":true,"navUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","relateUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","slug":"test","targetNew":false,"title":{"en_US":"测试","type":"i18n","zh_CN":"测试"}}],"isFixed":"y","isFold":"y","isFoldHorizontal":"n","languageChangeUrl":{"en_US":"/common/account/changeAccountLanguage.json","type":"i18n","zh_CN":"/common/account/changeAccountLanguage.json"},"layout":"auto","navStyle":"orange","navTheme":"light","openSubMode":false,"showAppTitle":true,"showCrumb":true,"showIcon":false,"showLanguageChange":true,"showNav":true,"showSearch":"n","singletons":{"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V":{"isFixed":"n","isFold":"n","isFoldHorizontal":"n","showAppTitle":false,"showCrumb":false,"showLanguageChange":false,"showNav":false,"showSearch":"n","singleton":false},"test":{"$ref":"$.singletons.FORM\\-3KYJN7RV\\-DIOD8LLK1WGQ89S7NHA92\\-QJVH497K\\-V"}},"type":"top_fold"}',
59+
'{"appName":{"en-US":"基础包管理后台","key":"","type":"i18n","zh-CN":"基础包管理后台"},"bgColor":"white","data":[{"children":[],"hidden":false,"icon":"","inner":true,"navUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","relateUuid":"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V","slug":"test","targetNew":false,"title":{"en-US":"测试","type":"i18n","zh-CN":"测试"}}],"isFixed":"y","isFold":"y","isFoldHorizontal":"n","languageChangeUrl":{"en-US":"/common/account/changeAccountLanguage.json","type":"i18n","zh-CN":"/common/account/changeAccountLanguage.json"},"layout":"auto","navStyle":"orange","navTheme":"light","openSubMode":false,"showAppTitle":true,"showCrumb":true,"showIcon":false,"showLanguageChange":true,"showNav":true,"showSearch":"n","singletons":{"FORM-3KYJN7RV-DIOD8LLK1WGQ89S7NHA92-QJVH497K-V":{"isFixed":"n","isFold":"n","isFoldHorizontal":"n","showAppTitle":false,"showCrumb":false,"showLanguageChange":false,"showNav":false,"showSearch":"n","singleton":false},"test":{"$ref":"$.singletons.FORM\\-3KYJN7RV\\-DIOD8LLK1WGQ89S7NHA92\\-QJVH497K\\-V"}},"type":"top_fold"}',
6060
historyType: 'HASH',
6161
isSinglePage: 'n',
6262
rhino: 'n',
Collapse file

‎modules/code-generator/src/plugins/project/i18n.ts‎

Copy file name to clipboardExpand all lines: modules/code-generator/src/plugins/project/i18n.ts
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
3434
};
3535
3636
const isEmptyVariables = variables => (
37-
Array.isArray(variables) && variables.length === 0
37+
Array.isArray(variables) && variables.length === 0
3838
|| typeof variables === 'object' && (!variables || Object.keys(variables).length === 0)
3939
);
4040
4141
// 按低代码规范里面的要求进行变量替换
4242
const format = (msg, variables) => (
43-
typeof msg === 'string'
43+
typeof msg === 'string'
4444
? msg.replace(/\\\$\\{(\\w+)\\}/g, (match, key) => variables?.[key] ?? '')
4545
: msg
4646
);
@@ -69,7 +69,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
6969
};
7070
target._i18nText = (t) => {
7171
// 优先取直接传过来的语料
72-
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')]
72+
const localMsg = t[locale] ?? t[String(locale).replace('-', '_')]
7373
if (localMsg != null) {
7474
return format(localMsg, t.params);
7575
}
@@ -81,7 +81,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
8181
}
8282
8383
// 兜底用 use 指定的或默认语言的
84-
return format(t[t.use || "zh_CN"] ?? t.en_US, t.params);
84+
return format(t[t.use || "zh-CN"] ?? t.en_US, t.params);
8585
}
8686
8787
// 注入到上下文中去
Collapse file

‎modules/code-generator/tests/bugfix/i18n-with-params.schema.json‎

Copy file name to clipboardExpand all lines: modules/code-generator/tests/bugfix/i18n-with-params.schema.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
}
4343
],
4444
"i18n": {
45-
"zh_CN": {
45+
"zh-CN": {
4646
"greetings.hello": "${name}, 你好!"
4747
},
48-
"en_US": {
48+
"en-US": {
4949
"greetings.hello": "Hello, ${name}!"
5050
}
5151
}
Collapse file

‎modules/code-generator/tests/bugfix/tolerate-eval-errors-1-loop.schema.json‎

Copy file name to clipboardExpand all lines: modules/code-generator/tests/bugfix/tolerate-eval-errors-1-loop.schema.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848
}
4949
],
5050
"i18n": {
51-
"zh_CN": {
51+
"zh-CN": {
5252
"greetings.hello": "${name}, 你好!"
5353
},
54-
"en_US": {
54+
"en-US": {
5555
"greetings.hello": "Hello, ${name}!"
5656
}
5757
}
Collapse file

‎modules/code-generator/tests/bugfix/tolerate-eval-errors-2-nested-loop.schema.json‎

Copy file name to clipboardExpand all lines: modules/code-generator/tests/bugfix/tolerate-eval-errors-2-nested-loop.schema.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@
6060
}
6161
],
6262
"i18n": {
63-
"zh_CN": {
63+
"zh-CN": {
6464
"greetings.hello": "${name}, 你好!"
6565
},
66-
"en_US": {
66+
"en-US": {
6767
"greetings.hello": "Hello, ${name}!"
6868
}
6969
}
Collapse file

‎modules/code-generator/tests/fixtures/test-cases/rax-app/demo01/expected/demo-project/src/i18n.js‎

Copy file name to clipboardExpand all lines: modules/code-generator/tests/fixtures/test-cases/rax-app/demo01/expected/demo-project/src/i18n.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const _inject2 = (target) => {
5252
}
5353

5454
// 兜底用 use 指定的或默认语言的
55-
return format(t[t.use || 'zh_CN'] ?? t.en_US, t.params);
55+
return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
5656
};
5757

5858
// 注入到上下文中去
Collapse file

‎modules/code-generator/tests/fixtures/test-cases/rax-app/demo02/expected/demo-project/src/i18n.js‎

Copy file name to clipboardExpand all lines: modules/code-generator/tests/fixtures/test-cases/rax-app/demo02/expected/demo-project/src/i18n.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const _inject2 = (target) => {
5252
}
5353

5454
// 兜底用 use 指定的或默认语言的
55-
return format(t[t.use || 'zh_CN'] ?? t.en_US, t.params);
55+
return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
5656
};
5757

5858
// 注入到上下文中去
Collapse file

‎modules/code-generator/tests/fixtures/test-cases/rax-app/demo03/expected/demo-project/src/i18n.js‎

Copy file name to clipboardExpand all lines: modules/code-generator/tests/fixtures/test-cases/rax-app/demo03/expected/demo-project/src/i18n.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const _inject2 = (target) => {
5252
}
5353

5454
// 兜底用 use 指定的或默认语言的
55-
return format(t[t.use || 'zh_CN'] ?? t.en_US, t.params);
55+
return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
5656
};
5757

5858
// 注入到上下文中去
Collapse file

‎modules/code-generator/tests/fixtures/test-cases/rax-app/demo04/expected/demo-project/src/i18n.js‎

Copy file name to clipboardExpand all lines: modules/code-generator/tests/fixtures/test-cases/rax-app/demo04/expected/demo-project/src/i18n.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const _inject2 = (target) => {
5252
}
5353

5454
// 兜底用 use 指定的或默认语言的
55-
return format(t[t.use || 'zh_CN'] ?? t.en_US, t.params);
55+
return format(t[t.use || 'zh-CN'] ?? t.en_US, t.params);
5656
};
5757

5858
// 注入到上下文中去

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.