File tree Expand file tree Collapse file tree
src/main/java/the/bytecode/club/bytecodeviewer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import java .io .File ;
44import java .io .IOException ;
5+ import java .util .Locale ;
6+
57import the .bytecode .club .bytecodeviewer .bootloader .BootState ;
68import the .bytecode .club .bytecodeviewer .gui .theme .LAFTheme ;
79import the .bytecode .club .bytecodeviewer .gui .theme .RSTATheme ;
@@ -83,7 +85,7 @@ public class Configuration
8385 public static boolean verifyCorruptedStateOnBoot = false ; //eventually may be a setting
8486
8587 public static BootState bootState = BootState .START_UP ;
86- public static Language language = Language . ENGLISH ;
88+ public static Language language = guessBestLanguage () ;
8789 public static LAFTheme lafTheme = LAFTheme .DARK ;
8890 public static RSTATheme rstaTheme = lafTheme .getRSTATheme ();
8991 public static long lastHotKeyExecuted = 0 ;
@@ -138,4 +140,17 @@ public static File getLastPluginDirectory()
138140 return new File ("." );
139141 }
140142
143+ public static Language guessBestLanguage ()
144+ {
145+ Locale systemLocale = Locale .getDefault ();
146+ String systemLanguage = systemLocale .getLanguage ();
147+
148+ Language language = Language .getLanguageCodeLookup ().get (systemLanguage );
149+
150+ if (language != null )
151+ return language ;
152+
153+ //fallback to english
154+ return Language .ENGLISH ;
155+ }
141156}
You can’t perform that action at this time.
0 commit comments