|
|
|
@ -24,6 +24,7 @@ import com.fr.general.ComparatorUtils;
|
|
|
|
|
import com.fr.general.FRLogFormatter; |
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
import com.fr.general.SupportLocale; |
|
|
|
|
import com.fr.general.locale.LocaleCenter; |
|
|
|
|
import com.fr.general.locale.LocaleMark; |
|
|
|
|
import com.fr.general.xml.GeneralXMLTools; |
|
|
|
@ -186,7 +187,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
|
|
|
|
|
if (designerEnvManager == null) { |
|
|
|
|
designerEnvManager = new DesignerEnvManager(); |
|
|
|
|
//REPORT-15332有一个国际化调用比较早,需要在这边就设置好locale,由于后台GeneralContext默认是China
|
|
|
|
|
GeneralContext.setLocale(designerEnvManager.getLanguage()); |
|
|
|
|
GeneralContext.setLocale(DesignerEnvManager.designerEnvManager.checkLocale(designerEnvManager.getLanguage())); |
|
|
|
|
try { |
|
|
|
|
XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
@ -1316,7 +1317,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
|
|
|
|
|
String tmpVal; |
|
|
|
|
if ((tmpVal = reader.getElementValue()) != null) { |
|
|
|
|
if (!CommonUtils.isNumber(tmpVal)) { |
|
|
|
|
setLanguage(CommonUtils.stringToLocale(tmpVal)); |
|
|
|
|
setLanguage(checkLocale(CommonUtils.stringToLocale(tmpVal))); |
|
|
|
|
} else { |
|
|
|
|
// 用于兼容10.0之前的版本
|
|
|
|
|
int value = Integer.parseInt(tmpVal); |
|
|
|
@ -1365,6 +1366,16 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 对国际化进行校验 |
|
|
|
|
* 非简繁英日韩的默认环境 设计器全部默认为英文版本 |
|
|
|
|
* @param locale |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private Locale checkLocale(Locale locale) { |
|
|
|
|
return SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void readReportLengthUnit(XMLableReader reader) { |
|
|
|
|
String tmpVal; |
|
|
|
|
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { |
|
|
|
|