/** * The <b>localized</b> title of this config screen */ protected String getTitle() { return EnderCore.lang.localize("config.title"); }
@Override @Nonnull public String getUnlocalizedName() { return EnderIOMachines.lang.addPrefix("block_powered_spawner.note." + langStr); }
@Override public @Nonnull String getLocalizedName() { return EnderIO.lang.localizeExact(unlocalizedName + ".name"); }
/** * Checks if the passed string (plus the prefix) has a localization mapped. * * @param unloc * The unlocalized suffix * @return True if there is a localization mapped, false otherwise. */ public boolean canLocalize(@Nonnull String unloc) { return canLocalizeExact(addPrefix(unloc)); }
/** * Localizes the string passed, first appending the prefix stored in this instance of the class. * * @param unloc * The unlocalized string. * * @return A localized string. */ public @Nonnull String localize(@Nonnull String unloc) { return localizeExact(addPrefix(unloc)); }
public static void addAdvancedTooltipEntries(@Nonnull ItemStack itemstack, EntityPlayer entityplayer, @Nonnull List<String> list, boolean flag) { SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack.getUnlocalizedName()); if (itemstack.getItem() instanceof IDarkSteelItem) { List<IDarkSteelUpgrade> applyableUpgrades = new ArrayList<IDarkSteelUpgrade>(); for (IDarkSteelUpgrade upgrade : UpgradeRegistry.getUpgrades()) { if (upgrade instanceof IAdvancedTooltipProvider && upgrade.hasUpgrade(itemstack, (IDarkSteelItem) itemstack.getItem())) { ((IAdvancedTooltipProvider) upgrade).addDetailedEntries(itemstack, entityplayer, list, flag); } else if (upgrade.canAddToItem(itemstack, (IDarkSteelItem) itemstack.getItem())) { applyableUpgrades.add(upgrade); } } if (!applyableUpgrades.isEmpty()) { list.add(TextFormatting.YELLOW + EnderIO.lang.localize("tooltip.anvilupgrades") + " "); for (IDarkSteelUpgrade up : applyableUpgrades) { list.add(Lang.DARK_STEEL_LEVELS1.get(TextFormatting.DARK_AQUA, EnderIO.lang.localizeExact(up.getUnlocalizedName() + ".name"))); list.add(Lang.DARK_STEEL_LEVELS2.get(TextFormatting.DARK_AQUA, TextFormatting.ITALIC, up.getUpgradeItemName(), up.getLevelCost())); } } } }
default @Nonnull NNList<String> getLines(@Nonnull Object... params) { NNList<String> result = new NNList<>(); for (int i = 1; i < 12; i++) { final String linekey = getKey() + ".line" + i; if (getLang().canLocalizeExact(linekey)) { result.add(getLang().localizeExact(linekey, params)); } else { return result; } } return result; }
/** * Get the detail for this itemstack * * @param stack * @return a list of <code>String</code>s to be bulleted under the enchantment */ default @Nonnull String[] getTooltipDetails(@Nonnull ItemStack stack) { final String unloc = "description." + ((Enchantment) this).getName(); final String loc = EnderCore.lang.localizeExact(unloc); return unloc.equals(loc) ? new String[0] : EnderCore.lang.splitList(loc); }
@Override public @Nonnull List<String> getTooltipLines() { return EnderIOMachines.lang.localizeAll(unlocTooltips); }
default void checkTranslation() { if (!getLang().canLocalizeExact(getKey()) && !getLang().canLocalizeExact(getKey() + ".line1")) { Log.error("Missing translation for '" + this + "': " + get()); } }
btnSync.setSelectedToolTip(EnderIO.lang.localize("gui.enabled")); btnSync.setUnselectedToolTip(EnderIO.lang.localize("gui.disabled")); if (Loader.isModLoaded("NotEnoughItems")) { btnSync.setToolTip(EnderIO.lang.localize("gui.inventorypanel.tooltip.sync.nei")); btnSync.setToolTip(EnderIO.lang.localize("gui.inventorypanel.tooltip.sync.jei")); btnSync.setSelectedToolTip(EnderIO.lang.localize("gui.enabled"), EnderIO.lang.localize("gui.inventorypanel.tooltip.sync.jei.line1"), EnderIO.lang.localize("gui.inventorypanel.tooltip.sync.jei.line2")); btnSync.setUnselectedToolTip(EnderIO.lang.localize("gui.disabled")); if (getTileEntity().getGuiSync()) { if (!te.getGuiFilterString().isEmpty()) { btnSync.setToolTip(EnderIO.lang.localize("gui.inventorypanel.tooltip.sync")); btnSync.setSelectedToolTip(EnderIO.lang.localize("gui.enabled")); btnSync.setUnselectedToolTip(EnderIO.lang.localize("gui.disabled")); btnSync.enabled = false; headerCrafting = EnderIO.lang.localize("gui.inventorypanel.header.crafting"); headerReturn = EnderIO.lang.localize("gui.inventorypanel.header.return"); headerStorage = EnderIO.lang.localize("gui.inventorypanel.header.storage"); headerInventory = EnderIO.lang.localizeExact("container.inventory"); infoTextFilter = EnderIO.lang.localize("gui.inventorypanel.info.filter"); infoTextOffline = EnderIO.lang.localize("gui.inventorypanel.info.offline");
/** * Localizes the string passed, first appending the prefix stored in this instance of the class. * * @param unloc * The unlocalized string. * @param args * The args to format the localized text with. * * @return A localized string. */ public @Nonnull String localize(@Nonnull String unloc, @Nonnull Object... args) { return localizeExact(addPrefix(unloc), args); }
/** * Splits the localized text on "|" into a String[]. * * @param unloc * The unlocalized string. * @param args * The args to format the localized text with. * @return A localized list of strings. */ public @Nonnull String[] localizeList(@Nonnull String unloc, @Nonnull String... args) { return splitList(localize(unloc, (Object[]) args)); }
/** * Localizes the strings before sending them. * * @see #sendNoSpamClient(String...) */ public static void sendNoSpamClientUnloc(@Nonnull Lang lang, @Nonnull String... unlocLines) { sendNoSpamClient(lang.localizeAll(lang, unlocLines)); }
public static @Nonnull String buildBaseName(@Nonnull String name, float level) { if (level < 1f) { name = EnderIO.lang.localize("loot.capacitor.baselevel.10", name); } else if (level < 1.5f) { name = EnderIO.lang.localize("loot.capacitor.baselevel.15", name); } else if (level < 2.5f) { name = EnderIO.lang.localize("loot.capacitor.baselevel.25", name); } else if (level < 3.5f) { name = EnderIO.lang.localize("loot.capacitor.baselevel.35", name); } else { name = EnderIO.lang.localize("loot.capacitor.baselevel.45", name); } return name; }
public static @Nonnull String getDisplayNameForEntity(@Nonnull String mobName) { return EnderIO.lang.localizeExact("entity." + mobName + ".name"); }
private Lang(@Nonnull String key) { if (key.startsWith(".")) { this.key = getLang().addPrefix(key.substring(1)); } else { this.key = key; } }
/** * Localizes the lines before sending them. * * @see #sendChat(EntityPlayer, String...) */ public static void sendChatUnloc(@Nonnull EntityPlayer player, @Nonnull Lang lang, @Nonnull String... unlocLines) { sendChat(player, lang.localizeAll(lang, unlocLines)); }
public static @Nonnull String buildName(@Nonnull String name, float level) { if (level < 1f) { name = EnderIO.lang.localize("loot.capacitor.level.10", name); } else if (level < 1.5f) { name = EnderIO.lang.localize("loot.capacitor.level.15", name); } else if (level < 2.5f) { name = EnderIO.lang.localize("loot.capacitor.level.25", name); } else if (level < 3f) { name = EnderIO.lang.localize("loot.capacitor.level.30", name); } else if (level < 3.5f) { name = EnderIO.lang.localize("loot.capacitor.level.35", name); } else if (level < 4f) { name = EnderIO.lang.localize("loot.capacitor.level.40", name); } else if (level < 4.25f) { name = EnderIO.lang.localize("loot.capacitor.level.42", name); } else { name = EnderIO.lang.localize("loot.capacitor.level.45", name); } return name; }