Skip to content

Commit 1adbd0b

Browse files
author
yanglibing
committed
添加 jsLangName 可选参数,用于控制生成的js语言变量名
1 parent acb02c7 commit 1adbd0b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
.svn/
44
bin/
55
out/
6-
6+
app/

src/com/yanglb/utilitys/codegen/core/translator/impl/MsgJsTranslatorImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ protected void onBeforeTranslate() throws CodeGenException {
5050
protected void onTranslate() throws CodeGenException {
5151
super.onTranslate();
5252
StringBuilder sb = this.writableModel.getData();
53-
sb.append("var Lang = { \r\n");
53+
String langName = "Lang";
54+
if(this.paramaModel.getOptions().get("jsLangName") != null) {
55+
langName = this.paramaModel.getOptions().get("jsLangName");
56+
}
57+
sb.append("var ");
58+
sb.append(langName);
59+
sb.append(" = { \r\n");
5460
int rowIndex = 0;
5561

5662
// 分组输出

0 commit comments

Comments
 (0)