currentToolTip.add( I18n.translateToLocalFormatted( "gui.tooltips.appliedenergistics2.P2PFrequency", freqTooltip ) );
@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 String localize(String key, Object... arguments) { return I18n.translateToLocalFormatted(key, arguments); }
public String translate(String s, Object... format) { if (prefix != null && !s.startsWith(prefix + ".")) s = prefix + "." + s; return I18n.translateToLocalFormatted(s, format); }
@SuppressWarnings("deprecation") @Override public void addTooltipForCalendarEntry(List<String> tooltip) { tooltip.add(I18n.translateToLocalFormatted("harvestfestival.npc.tooltip.birthday", getLocalizedName())); }
@SuppressWarnings("deprecation") @Override public String getLocalizedText(EntityPlayer player, EntityAgeable ageable, NPC npc) { return I18n.translateToLocalFormatted(text, HFApi.quests.hasCompleted(Quests.TOMAS_15K, player) ? 1000 : 2500); } }
@Override public String getLocalized(NPCEntity entity) { int score = QuestHarvestFestival.getPotScore(entity); return I18n.translateToLocalFormatted(unlocalised + score); } }
public static String translateToLocal( final String string, final Object... args ) { return I18n.translateToLocalFormatted( string, args ); }
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; }
@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); } }
@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 getKeyName(int key) { if (key < 0) { return I18n.translateToLocalFormatted("key.mouseButton", key + 101); } else if (key > Keyboard.KEYBOARD_SIZE) { return Keyboard.getKeyName(0); } return Keyboard.getKeyName(key); }
@Override public String getItemStackDisplayName(ItemStack stack) { EnumDragonBreed type = EnumDragonBreed.META_MAPPING.inverse().get(stack.getMetadata()); String breedName = I18n.translateToLocal("entity.DragonMounts.DragonMount." + type.getName() + ".name"); return I18n.translateToLocalFormatted("item.dragonEgg.name", breedName); } }
private static void save(ICommandSender sender, Object object, Type type, String name) throws CommandException { try { File file = SaveHandler.save(SaveHandler.getExportFile(name), object, type); sender.sendMessage(new TextComponentString(I18n.translateToLocalFormatted(Lang.SAVE_SUCCESS, file.getPath().substring(HardcoreQuesting.configDir.getParentFile().getParent().length())))); } catch (IOException e) { throw new CommandException(Lang.SAVE_FAILED, name); } }
/** Use this helper in conjunction with getLocalizedScript * @param quest short form name **/ @SuppressWarnings("deprecation") @SideOnly(Side.CLIENT) public String getLocalized(String quest, Object... format) { if (format.length == 0) return I18n.translateToLocal(getPrefix() + "." + quest.replace("_", "")); else return I18n.translateToLocalFormatted(getPrefix() + "." + quest.replace("_", ""), format); }
/** * Gets the localized seed name for this crop * * @return seed name */ @SuppressWarnings("deprecation") public String getSeedsName() { String name = alternativeName ? I18n.translateToLocalFormatted((getResource().getResourceDomain() + ".crop." + StringUtils.replace(getResource().getResourcePath(), "_", ".") + ".block")) : item == null ? "NULL" : item.getDisplayName(); String seeds = I18n.translateToLocal("harvestfestival.crop.seeds"); String format = I18n.translateToLocal("harvestfestival.crop.seeds.format"); return String.format(format, name, seeds); }
@SuppressWarnings("deprecation") @Override public String getLocalizedText(EntityPlayer player, EntityNPCBuilder builder, NPC npc) { BuildingStage stage = TownHelper.getClosestTownToEntity(builder, false).getCurrentlyBuilding(); String toLocalize = MODID + ".npc.builder." + stage.getStage().name().toLowerCase(Locale.ENGLISH); return I18n.translateToLocalFormatted(toLocalize, stage.getBuilding().getLocalisedName()); }
@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()); }
@Override public String getLocalized(NPCEntity entity) { return I18n.translateToLocalFormatted(unlocalised, entity.getNPC().getResource().getResourceDomain(), entity.getNPC().getResource().getResourcePath()); } }
@Override @SuppressWarnings("deprecation") public String getLocalizedText(EntityPlayer player, EntityAgeable ageable, NPC npc) { CalendarDate birthday = HFTrackers.getClientPlayerTracker().getStats().getBirthday(); if (birthday != null) { int years = CalendarHelper.getYearsPassed(birthday, HFTrackers.getCalendar(MCClientHelper.getWorld()).getDate()); if (years <= 0) return I18n.translateToLocal("harvestfestival.npc.tiberius.first"); return I18n.translateToLocalFormatted("harvestfestival.npc.tiberius.time", years); } else return I18n.translateToLocal("harvestfestival.npc.tiberius.first"); }