A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(examples): ui-controls ships en + zh-CN locale tables - zero-code localization
yhh3fa4f77f2988
diff --git a/examples/ui-controls/assets/i18n/en.eslocale b/examples/ui-controls/assets/i18n/en.eslocalenew file mode 100644index 000000000..3530004c9--- /dev/null+++ b/examples/ui-controls/assets/i18n/en.eslocale@@ -0,0 +1,11 @@+{+ "version": 1,+ "locale": "en",+ "entries": {+ "ui.title": "UI Controls",+ "ui.animate": "Animate",+ "ui.loading": "Loading",+ "ui.modal": "Modal",+ "ui.accent": "Accent"+ }+}diff --git a/examples/ui-controls/assets/i18n/en.eslocale.meta b/examples/ui-controls/assets/i18n/en.eslocale.metanew file mode 100644index 000000000..2441fe039--- /dev/null+++ b/examples/ui-controls/assets/i18n/en.eslocale.meta@@ -0,0 +1,6 @@+{+ "uuid": "5a1c9f02-6b3d-4e78-9c41-8d2f7a604b13",+ "version": "2.0",+ "type": "locale",+ "importer": {}+}diff --git a/examples/ui-controls/assets/i18n/zh-CN.eslocale b/examples/ui-controls/assets/i18n/zh-CN.eslocalenew file mode 100644index 000000000..7d8f106e6--- /dev/null+++ b/examples/ui-controls/assets/i18n/zh-CN.eslocale@@ -0,0 +1,11 @@+{+ "version": 1,+ "locale": "zh-CN",+ "entries": {+ "ui.title": "UI 控件",+ "ui.animate": "动画",+ "ui.loading": "加载",+ "ui.modal": "对话框",+ "ui.accent": "强调色"+ }+}diff --git a/examples/ui-controls/assets/i18n/zh-CN.eslocale.meta b/examples/ui-controls/assets/i18n/zh-CN.eslocale.metanew file mode 100644index 000000000..eb30c0d49--- /dev/null+++ b/examples/ui-controls/assets/i18n/zh-CN.eslocale.meta@@ -0,0 +1,6 @@+{+ "uuid": "7e4b2d81-9f5a-4c36-b027-1a6c8e953d42",+ "version": "2.0",+ "type": "locale",+ "importer": {}+}diff --git a/examples/ui-controls/assets/scenes/main.esscene b/examples/ui-controls/assets/scenes/main.essceneindex 15d42b69c..886e48f5b 100644--- a/examples/ui-controls/assets/scenes/main.esscene+++ b/examples/ui-controls/assets/scenes/main.esscene@@ -125,6 +125,7 @@"type": "Text","data": {"content": "UI Controls",+ "i18nKey": "ui.title","fontSize": 20,"bold": true,"color": { "r": 1, "g": 1, "b": 1, "a": 1 },@@ -214,6 +215,7 @@"type": "Text","data": {"content": "Animate",+ "i18nKey": "ui.animate","fontSize": 14,"color": { "r": 1, "g": 1, "b": 1, "a": 1 },"align": 0,@@ -302,6 +304,7 @@"type": "Text","data": {"content": "Loading",+ "i18nKey": "ui.loading","fontSize": 14,"color": { "r": 1, "g": 1, "b": 1, "a": 1 },"align": 0,@@ -346,6 +349,7 @@"type": "Text","data": {"content": "Modal",+ "i18nKey": "ui.modal","fontSize": 14,"color": { "r": 1, "g": 1, "b": 1, "a": 1 },"align": 0,@@ -390,6 +394,7 @@"type": "Text","data": {"content": "Accent",+ "i18nKey": "ui.accent","fontSize": 14,"color": { "r": 1, "g": 1, "b": 1, "a": 1 },"align": 0,diff --git a/sdk/src/ui/core/text.ts b/sdk/src/ui/core/text.tsindex 1c97658ab..4180fc973 100644--- a/sdk/src/ui/core/text.ts+++ b/sdk/src/ui/core/text.ts@@ -91,7 +91,7 @@ export const Text = defineComponent<TextData>('Text', {enabled: true,}, {fields: {- i18nKey: { tooltip: 'Localization key — when set, content is resolved from the Localization catalogs (and re-resolved on locale switch). Leave empty for plain text.' },+ i18nKey: { label: 'I18n Key', tooltip: 'Localization key — when set, content is resolved from the Localization catalogs (and re-resolved on locale switch). Leave empty for plain text.' },align: { enum: enumOptions(TextAlign), tooltip: 'Horizontal alignment: within the layout box when the entity has a UINode, else it anchors the text to the entity origin (left/center/right edge).' },verticalAlign: { enum: enumOptions(TextVerticalAlign), tooltip: 'Vertical alignment: within the layout box when the entity has a UINode, else it anchors the text to the entity origin (top/middle/bottom).' },overflow: { enum: enumOptions(TextOverflow) },