Browse Source

Pull request #2297: REPORT-39341 【回归】文件没有读写权限报告弹窗是英文

Merge in DESIGN/design from ~YVAN/design:release/10.0 to release/10.0

* commit 'fe6973e495f9b322690a60eb8dce29f2f724f0ea':
  REPORT-39341 【回归】文件没有读写权限报告弹窗是英文 修改解决方案:经过多位大佬提醒,最好不要直接修改传过来的Locale,因此转变思路为如果接收到了比较奇怪的Locale,尽量找到一个在本项目中使用的最接近的Locale返回,如传入参数为zh-Hans-CN时,返回zh_CN,而不是之前的en_US
  更新单元测试
  更新单元测试
  补充单元测试
  REPORT-39341 【回归】【jdk11】文件没有读写权限报告弹窗是英文 1. bug原因:在中文环境下,这边传过来的Locale是zh-Hans-CN,进入isSupport方法中时会发现不匹配,然后Locale被设置成en_US,然后在报错弹窗里面的内容就都是英文了 2. 修改方案:增加判断,将传过来的Locale的script抹去,只保留language和region,跟代码里面保存的Locale保持一致
feature/big-screen
Yvan 4 years ago
parent
commit
1d1c5580a0
  1. 14
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

14
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -163,7 +163,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
* alphafine
*/
private AlphaFineConfigManager alphaFineConfigManager = AlphaFineConfigManager.getInstance();
/**
* 阅后即焚的配置项
*/
@ -1424,7 +1424,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
* @return
*/
private Locale checkLocale(Locale locale) {
return SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US;
// Yvan: REPORT-39341,有一些情况下,获取到的是zh-Hans-CN这种,需要找到项目中最匹配的Locale
return SupportLocale.getInstance().isSupport(locale) ?
locale : SupportLocale.getInstance().getSuitableLocale(locale);
}
private void readReportLengthUnit(XMLableReader reader) {
@ -1578,7 +1580,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
}
}
private void readSnapChatConfig(XMLableReader reader) {
reader.readXMLObject(this.snapChatConfig = SnapChatConfig.getInstance());
}
@ -1801,14 +1803,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
writeSnapChatConfig(writer);
writer.end();
}
private void writeSnapChatConfig(XMLPrintWriter writer) {
if (this.snapChatConfig != null) {
this.snapChatConfig.writeXML(writer);
}
}
private void writeAlphaFineAttr(XMLPrintWriter writer) {
if (this.alphaFineConfigManager != null) {
this.alphaFineConfigManager.writeXML(writer);

Loading…
Cancel
Save