File tree Expand file tree Collapse file tree 5 files changed +14
-54
lines changed
src/com/yanglb/utilitys/codegen/core/translator Expand file tree Collapse file tree 5 files changed +14
-54
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,17 @@ protected void onBeforeTranslate() throws CodeGenException {
3838 fileName = this .msgLang ;
3939 } else {
4040 if (!this .isDefaultLanguage ()) {
41- fileName = fileName + "." + this .msgLang ;
41+ fileName = fileName + this . getSplitString () + this .msgLang ;
4242 }
4343 }
4444
4545 this .writableModel .setFileName (fileName );
4646 }
4747
48+ protected String getSplitString () {
49+ return "." ;
50+ }
51+
4852 /**
4953 * 文件名,优先使用--fn参数指定的文件名,如不指定使用excel名称
5054 * @return 文件名
Original file line number Diff line number Diff line change 11/**
2- * Copyright 2015 yanglb.com
2+ * Copyright 2020 yanglb.com
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -26,7 +26,9 @@ public class MsgCSTranslatorImpl extends BaseMsgTranslator {
2626 @ Override
2727 protected void onBeforeTranslate () throws CodeGenException {
2828 super .onBeforeTranslate ();
29+
2930 this .writableModel .setExtension ("resx" );
31+ this .writableModel .setFilePath ("msg/resx" );
3032 }
3133
3234 @ Override
Original file line number Diff line number Diff line change 2323import com .yanglb .utilitys .codegen .utility .StringUtility ;
2424
2525public class MsgJavaTranslatorImpl extends BaseMsgTranslator {
26- protected String msgLang = "" ;
27-
26+ @ Override
27+ protected String getSplitString () {
28+ return "_" ;
29+ }
30+
2831 @ Override
2932 protected void onBeforeTranslate () throws CodeGenException {
3033 super .onBeforeTranslate ();
3134
32- // 当前生成的国际化语言
33- this .msgLang = this .settingMap .get ("MsgLang" );
34-
35- // 文件名
36- String fileName = getFileName ();
37- if (fileName .equals ("" )) {
38- // 空文件名
39- fileName = this .msgLang ;
40- } else {
41- if (!this .msgLang .equals ("default" )) {
42- fileName = fileName + "_" + this .msgLang ;
43- }
44- }
45-
46- this .writableModel .setFileName (fileName );
4735 this .writableModel .setExtension ("properties" );
4836 this .writableModel .setFilePath ("msg/properties" );
4937 }
Original file line number Diff line number Diff line change 2323import com .yanglb .utilitys .codegen .utility .StringUtility ;
2424
2525public class MsgJsTranslatorImpl extends BaseMsgTranslator {
26- protected String msgLang = "" ;
27-
2826 @ Override
2927 protected void onBeforeTranslate () throws CodeGenException {
3028 super .onBeforeTranslate ();
31-
32- // 当前生成的国际化语言
33- this .msgLang = this .settingMap .get ("MsgLang" );
34-
35- // 文件名
36- String fileName = getFileName ();
37- if (fileName .equals ("" )) {
38- // 空文件名
39- fileName = this .msgLang ;
40- } else {
41- if (!this .msgLang .equals ("default" )) {
42- fileName = fileName + "." + this .msgLang ;
43- }
44- }
45-
46- this .writableModel .setFileName (fileName );
29+
4730 this .writableModel .setExtension ("js" );
4831 this .writableModel .setFilePath ("msg/js" );
4932 }
Original file line number Diff line number Diff line change 2323import com .yanglb .utilitys .codegen .utility .StringUtility ;
2424
2525public class MsgJsonTranslatorImpl extends BaseMsgTranslator {
26- protected String msgLang = "" ;
27-
2826 @ Override
2927 protected void onBeforeTranslate () throws CodeGenException {
3028 super .onBeforeTranslate ();
3129
32- // 当前生成的国际化语言
33- this .msgLang = this .settingMap .get ("MsgLang" );
34-
35- // 文件名
36- String fileName = getFileName ();
37- if (fileName .equals ("" )) {
38- // 空文件名
39- fileName = this .msgLang ;
40- } else {
41- if (!this .msgLang .equals ("default" )) {
42- fileName = fileName + "." + this .msgLang ;
43- }
44- }
45-
46- this .writableModel .setFileName (fileName );
4730 this .writableModel .setExtension ("json" );
4831 this .writableModel .setFilePath ("msg/json" );
4932 }
You can’t perform that action at this time.
0 commit comments