From ce540ef97b54a4c4e5eef3876009b45481567df9 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 9 Sep 2020 17:50:19 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-39341=20=E3=80=90=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E3=80=91=E3=80=90jdk11=E3=80=91=E6=96=87=E4=BB=B6=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=AF=BB=E5=86=99=E6=9D=83=E9=99=90=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=98=AF=E8=8B=B1=E6=96=87=201.=20bug?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=EF=BC=9A=E5=9C=A8=E4=B8=AD=E6=96=87=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=EF=BC=8C=E8=BF=99=E8=BE=B9=E4=BC=A0=E8=BF=87?= =?UTF-8?q?=E6=9D=A5=E7=9A=84Locale=E6=98=AFzh-Hans-CN=EF=BC=8C=E8=BF=9B?= =?UTF-8?q?=E5=85=A5isSupport=E6=96=B9=E6=B3=95=E4=B8=AD=E6=97=B6=E4=BC=9A?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E4=B8=8D=E5=8C=B9=E9=85=8D=EF=BC=8C=E7=84=B6?= =?UTF-8?q?=E5=90=8ELocale=E8=A2=AB=E8=AE=BE=E7=BD=AE=E6=88=90en=5FUS?= =?UTF-8?q?=EF=BC=8C=E7=84=B6=E5=90=8E=E5=9C=A8=E6=8A=A5=E9=94=99=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E9=87=8C=E9=9D=A2=E7=9A=84=E5=86=85=E5=AE=B9=E5=B0=B1?= =?UTF-8?q?=E9=83=BD=E6=98=AF=E8=8B=B1=E6=96=87=E4=BA=86=202.=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=B9=E6=A1=88=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E6=96=AD=EF=BC=8C=E5=B0=86=E4=BC=A0=E8=BF=87=E6=9D=A5=E7=9A=84?= =?UTF-8?q?Locale=E7=9A=84script=E6=8A=B9=E5=8E=BB=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E4=BF=9D=E7=95=99language=E5=92=8Cregion=EF=BC=8C=E8=B7=9F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=87=8C=E9=9D=A2=E4=BF=9D=E5=AD=98=E7=9A=84?= =?UTF-8?q?Locale=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/DesignerEnvManager.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 88d2625d02..375e40e4c0 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/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,6 +1424,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * @return */ private Locale checkLocale(Locale locale) { + // Yvan: REPORT-39341,有一些情况下,获取到的是zh-Hans-CN,转成zh_CN + if (locale != null) { + locale = new Locale(locale.getLanguage(), locale.getCountry()); + } return SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US; } @@ -1578,7 +1582,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } } } - + private void readSnapChatConfig(XMLableReader reader) { reader.readXMLObject(this.snapChatConfig = SnapChatConfig.getInstance()); } @@ -1801,14 +1805,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);