From 986f52b1e1425b60e349cb9adf5570fd7ed7ae31 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 5 Jan 2014 11:34:34 +1100 Subject: [PATCH] Try harder to find translations when not using English. Closes #787 --- proxy/src/main/java/net/md_5/bungee/BungeeCord.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index 7761ba2f1..3d519e066 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -27,6 +27,7 @@ import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; import java.util.HashSet; +import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; @@ -84,7 +85,7 @@ public class BungeeCord extends ProxyServer /** * Localization bundle. */ - public final ResourceBundle bundle = ResourceBundle.getBundle( "messages" ); + public ResourceBundle bundle; public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() ); /** * locations.yml save thread. @@ -149,6 +150,14 @@ public class BungeeCord extends ProxyServer public BungeeCord() throws IOException { + try + { + bundle = ResourceBundle.getBundle( "messages" ); + } catch ( MissingResourceException ex ) + { + bundle = ResourceBundle.getBundle( "messages", Locale.ENGLISH ); + } + Log.setOutput( new PrintStream( ByteStreams.nullOutputStream() ) ); // TODO: Bug JLine AnsiConsole.systemInstall(); consoleReader = new ConsoleReader();