Dont throw exceptions on missing translations

This commit is contained in:
md_5 2013-05-25 11:54:17 +10:00
parent ddb93fd988
commit 77e0dcc7f8
2 changed files with 9 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
@ -330,7 +331,14 @@ public class BungeeCord extends ProxyServer
@Override @Override
public String getTranslation(String name) public String getTranslation(String name)
{ {
return bundle.getString( name ); String translation = "<translation '" + name + "' missing>";
try
{
translation = bundle.getString( name );
} catch ( MissingResourceException ex )
{
}
return translation;
} }
@Override @Override

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.connection; package net.md_5.bungee.connection;
import java.util.Arrays;
import net.md_5.bungee.BungeeCord; import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.EntityMap; import net.md_5.bungee.EntityMap;
import net.md_5.bungee.UserConnection; import net.md_5.bungee.UserConnection;