mirror of
https://gitee.com/dgflash/oops-framework.git
synced 2026-06-03 19:09:36 +08:00
扩展多语言模块,支持通过oops-plugin-excel-to-json插件导入Excel配置表中的多语言配置数据
This commit is contained in:
1
assets/resources/config/game/Language.json
Normal file
1
assets/resources/config/game/Language.json
Normal file
@@ -0,0 +1 @@
|
||||
{"role_level_up":{"zh":"升级","en":"Upgrade"},"role_attack":{"zh":"攻击","en":"Attack"}}
|
||||
11
assets/resources/config/game/Language.json.meta
Normal file
11
assets/resources/config/game/Language.json.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "2.0.0",
|
||||
"importer": "json",
|
||||
"imported": true,
|
||||
"uuid": "b92e9be8-b6df-4e15-8b4b-16326a243229",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
27
assets/script/game/common/table/TableLanguage.ts
Normal file
27
assets/script/game/common/table/TableLanguage.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
import { JsonUtil } from "../../../../../extensions/oops-plugin-framework/assets/core/utils/JsonUtil";
|
||||
|
||||
export class TableLanguage {
|
||||
static TableName: string = "Language";
|
||||
|
||||
private data: any;
|
||||
|
||||
init(id: number) {
|
||||
var table = JsonUtil.get(TableLanguage.TableName);
|
||||
this.data = table[id];
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** 编号【KEY】 */
|
||||
id: number = 0;
|
||||
|
||||
/** 简体中文 */
|
||||
get zh(): string {
|
||||
return this.data.zh;
|
||||
}
|
||||
/** 英文 */
|
||||
get en(): string {
|
||||
return this.data.en;
|
||||
}
|
||||
}
|
||||
|
||||
9
assets/script/game/common/table/TableLanguage.ts.meta
Normal file
9
assets/script/game/common/table/TableLanguage.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "290f6330-3789-4738-a324-70369ca98be5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
BIN
excel/Language.xlsx
Normal file
BIN
excel/Language.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user