From 977a53a674e0d8e436ffc8a82a010e86e6db1efa Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 6 Aug 2024 16:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/base/i18n/BidiUtils.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java b/designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java index 7e3a4f625c..60652ac8ef 100644 --- a/designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java +++ b/designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java @@ -1,5 +1,7 @@ package com.fr.base.i18n; +import com.fr.design.DesignerEnvManager; + import javax.swing.border.TitledBorder; import java.awt.Component; import java.awt.ComponentOrientation; @@ -15,9 +17,7 @@ import java.util.Locale; */ public class BidiUtils { - //private static final Locale ar = new Locale("ar", "SA"); - private static final Locale ar = true ? new Locale("ar", "SA") : Locale.CHINA; - //private static final Locale ar = Locale.CHINA; + private static final Locale LOCALE = DesignerEnvManager.getEnvManager().getLanguage(); @@ -25,33 +25,33 @@ public class BidiUtils { } public static ComponentOrientation getOrientationByLocale() { - return ComponentOrientation.getOrientation(ar); + return ComponentOrientation.getOrientation(LOCALE); } public static T applyOrientationByLocale(T component) { - component.applyComponentOrientation(ComponentOrientation.getOrientation(ar)); + component.applyComponentOrientation(ComponentOrientation.getOrientation(LOCALE)); return component; } public static T setOrientationByLocale(T component) { - component.setComponentOrientation(ComponentOrientation.getOrientation(ar)); + component.setComponentOrientation(ComponentOrientation.getOrientation(LOCALE)); return component; } public static void setOrientationByLocale(Component... components) { for (Component component : components) { - component.setComponentOrientation(ComponentOrientation.getOrientation(ar)); + component.setComponentOrientation(ComponentOrientation.getOrientation(LOCALE)); } } public static void applyOrientationByLocale(Component... components) { for (Component component : components) { - component.applyComponentOrientation(ComponentOrientation.getOrientation(ar)); + component.applyComponentOrientation(ComponentOrientation.getOrientation(LOCALE)); } } public static boolean rtl() { - return ComponentOrientation.getOrientation(ar) == ComponentOrientation.RIGHT_TO_LEFT; + return ComponentOrientation.getOrientation(LOCALE) == ComponentOrientation.RIGHT_TO_LEFT; } public static String reverseConcatenateStrings(String... strs) { StringBuilder result = new StringBuilder();