Correct toLegacyText the same way toPlainText was previously

This commit is contained in:
Thinkofdeath 2014-08-17 18:50:28 +01:00
parent 664c66fb97
commit e573f7b89c

View File

@ -173,13 +173,9 @@ public class TranslatableComponent extends BaseComponent
@Override
protected void toLegacyText(StringBuilder builder)
{
String trans = locales.getString( translate );
if ( trans == null )
{
addFormat( builder );
builder.append( translate );
} else
try
{
String trans = locales.getString( translate );
Matcher matcher = format.matcher( trans );
int position = 0;
int i = 0;
@ -212,6 +208,10 @@ public class TranslatableComponent extends BaseComponent
addFormat( builder );
builder.append( trans.substring( position, trans.length() ) );
}
} catch ( MissingResourceException e )
{
addFormat( builder );
builder.append( translate );
}
super.toLegacyText( builder );
}