mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
run textcomponenttranslations through the ForgeI18N message format translator as well.
This commit is contained in:
1 parent
e199e78a4f
commit
43ed744d46
2 files changed
+31
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package net.minecraftforge.fml;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TextComponentMessageFormatHandler {
|
||||
public static int handle(final TextComponentTranslation parent, final List<ITextComponent> children, final Object[] formatArgs, final String format) {
|
||||
try {
|
||||
children.add(new TextComponentString(ForgeI18n.parseFormat(format, formatArgs)));
|
||||
return format.length();
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user