Java Code Examples for net.minecraft.util.text.translation.I18n#translateToLocalFormatted()
The following examples show how to use
net.minecraft.util.text.translation.I18n#translateToLocalFormatted() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemFluidContainer.java From customstuff4 with GNU General Public License v3.0 | 6 votes |
@Override @Nonnull public String getItemStackDisplayName(@Nonnull ItemStack stack) { FluidStack fluidStack = getFluid(stack); if (fluidStack == null) { return super.getItemStackDisplayName(stack); } String unloc = this.getUnlocalizedNameInefficiently(stack); if (I18n.canTranslate(unloc + "." + fluidStack.getFluid().getName())) { return I18n.translateToLocal(unloc + "." + fluidStack.getFluid().getName()); } return I18n.translateToLocalFormatted(unloc + ".filled.name", fluidStack.getLocalizedName()); }
Example 2
Source File: Option.java From NotEnoughItems with MIT License | 4 votes |
public String translateN(String s, Object... args) { return I18n.translateToLocalFormatted(namespaced(s), args); }
Example 3
Source File: LocalizedException.java From LunatriusCore with MIT License | 4 votes |
public LocalizedException(final String format, final Object... arguments) { super(I18n.translateToLocalFormatted(format, arguments)); }
Example 4
Source File: TranslationUtils.java From OpenModsLib with MIT License | 4 votes |
public static String translateToLocalFormatted(String key, Object... args) { return I18n.translateToLocalFormatted(key, args); }