Skip to content

Commit f23a4a1

Browse files
committed
Fix locale usage in RSyntaxTextArea
Our code uses the locale explicitly for i18n. But RSyntaxTextArea uses the default locale everywhere for its controls and dialogs. To combat that we will just change the default locale at the start of the app.
1 parent d888565 commit f23a4a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/itextpdf/rups/Rups.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ This file is part of the iText (R) project.
6262
import java.io.IOException;
6363
import java.io.InputStream;
6464
import java.util.List;
65+
import java.util.Locale;
6566
import java.util.Properties;
6667
import javax.swing.JFrame;
6768
import javax.swing.SwingUtilities;
@@ -94,6 +95,13 @@ public static void showBriefMessage(String message) {
9495
*/
9596
public static void startNewApplication(final List<File> files) {
9697
SwingUtilities.invokeLater(() -> {
98+
/*
99+
* While we get the locale explicitly for our localized strings,
100+
* some of the 3rd party Swings components use the default locale
101+
* for string (ex. RSyntaxTextArea). So we need to change the
102+
* default locale for everything to look consistent.
103+
*/
104+
Locale.setDefault(RupsConfiguration.INSTANCE.getUserLocale());
97105
setLookandFeel();
98106
final IRupsController rupsController = initApplication(new JFrame());
99107
setOpenFileHandler(

0 commit comments

Comments
 (0)