public String getName() { final String s = I18n.translateToLocal( this.unlocalizedName + ".name" ); if( s.equals( this.unlocalizedName + ".name" ) ) { return I18n.translateToLocal( this.unlocalizedName ); } return s; }
@Override @SideOnly( Side.CLIENT ) public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips ) { lines.add( this.getLocalizedName( this.getSettingsName( stack ) + ".name", this.getSettingsName( stack ) ) ); final NBTTagCompound data = this.getData( stack ); if( data.hasKey( "tooltip" ) ) { lines.add( I18n.translateToLocal( this.getLocalizedName( data.getString( "tooltip" ) + ".name", data.getString( "tooltip" ) ) ) ); } if( data.hasKey( "freq" ) ) { final short freq = data.getShort( "freq" ); final String freqTooltip = TextFormatting.BOLD + Platform.p2p().toHexString( freq ); lines.add( I18n.translateToLocalFormatted( "gui.tooltips.appliedenergistics2.P2PFrequency", freqTooltip ) ); } }
@SuppressWarnings("deprecation") public static String translateToLocal(String key) { if (I18n.canTranslate(key)) { return I18n.translateToLocal(key); } else { return I18n.translateToFallback(key); } }
@SuppressWarnings("deprecation") @Override public String getItemStackDisplayName(final ItemStack stack) { final FluidStack fluidStack = getFluid(stack); final String unlocalisedName = this.getUnlocalizedNameInefficiently(stack); if (fluidStack == null) return I18n.translateToLocal(unlocalisedName + ".name").trim(); final String fluidUnlocalisedName = unlocalisedName + ".filled." + fluidStack.getFluid().getName() + ".name"; if (I18n.canTranslate(fluidUnlocalisedName)) return I18n.translateToLocal(fluidUnlocalisedName); return I18n.translateToLocalFormatted(unlocalisedName + ".filled.name", fluidStack.getLocalizedName()); }
currentToolTip.add( I18n.translateToLocalFormatted( "gui.tooltips.appliedenergistics2.P2PFrequency", freqTooltip ) );
@Nonnull @SuppressWarnings("deprecation") static String format(String key, Object... params) { return I18n.canTranslate(key) ? I18n.translateToLocalFormatted(key, params) : String.format(Locale.US, I18n.translateToFallback(key), params); } }
public static String translate(String langKey, Object... args) { return net.minecraft.util.text.translation.I18n.canTranslate(langKey) ? net.minecraft.util.text.translation.I18n.translateToLocalFormatted(langKey, args) : langKey; }
@SuppressWarnings("deprecation") private static boolean canTranslate(String key) { return I18n.canTranslate(key); } }
@Override public String localise(String input) { if(!minerServer.playerHasClient(player.getPersistentID())) { return I18n.translateToFallback(input); } return input; } }
public static String translateToLocal(String key) { if (I18n.canTranslate(key)) { return I18n.translateToLocal(key); } else { return I18n.translateToFallback(key); } }
@SuppressWarnings("deprecation") public String localize(String key, Object... arguments) { return I18n.translateToLocalFormatted(key, arguments); }
@SuppressWarnings("deprecation") public static boolean canTranslateToLocal(String key) { return I18n.canTranslate(key); }
private int countWords(String s) { String s1 = I18n.translateToLocal(s); return s1.split("\\s+").length; }
public static String translateToLocal( final String string, final Object... args ) { return I18n.translateToLocalFormatted( string, args ); }
public String localise(String key) { if (I18n.canTranslate(key)) { return I18n.translateToLocal(key); } else { return I18n.translateToFallback(key); } }
@SuppressWarnings("deprecation") public static String format(String key, Object... data) { return I18n.translateToLocalFormatted(key, data); }
public static boolean canTranslate(String key) { return I18n.canTranslate(key); } }
@Nonnull @Override public String getItemStackDisplayName(@Nonnull ItemStack stack) { String flowerName = getTranslationKey(stack) + ".name"; return String.format(I18n.translateToLocal("botaniamisc.floatingPrefix"), I18n.translateToLocal(flowerName)); }
@SuppressWarnings("deprecation") @SideOnly(Side.CLIENT) public String getLocalized(String quest, Object... format) { if (format.length == 0) return I18n.translateToLocal(prefix + "." + quest.replace("_", "")); else return I18n.translateToLocalFormatted(prefix + "." + quest.replace("_", ""), format); }
public static String translate(String key) { if (I18n.canTranslate(key)) { return I18n.translateToLocal(key); } else { return I18n.translateToFallback(key); } }