net.minecraft.util.text.translation.I18n Java Examples

The following examples show how to use net.minecraft.util.text.translation.I18n. 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: GuiButtonDownloaded.java    From VersionChecker with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void drawButton(Minecraft minecraft, int x, int y, float partialTicks)
{
    if (this.visible)
    {
        Minecraft.getMinecraft().getTextureManager().bindTexture(Resources.GUI_BUTTON_TICK);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        boolean flag = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height;
        int k = 0;
        int j = 0;
        if (flag)
        {
            k += this.height;
        }
        if (ticked)
        {
            j += this.width;
        }
        Gui.drawModalRectWithCustomSizedTexture(this.x, this.y, j, k, this.width, this.height, 40, 40);
        this.drawString(Minecraft.getMinecraft().fontRenderer, I18n.translateToLocal(Strings.MARK_DL), this.x + this.width + 5, this.y + this.height / 2 - 4, 0xFFFFFF);
    }
}
 
Example #2
Source File: ItemFluidContainer.java    From customstuff4 with GNU General Public License v3.0 6 votes vote down vote up
@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 #3
Source File: GuiUpdates.java    From VersionChecker with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void openInfoScreen(Update update)
{
    openUpdate = update;
    updateButton.visible = true;
    closeButton.visible = true;
    changeLogList.disableInput = false;
    updateList.disableInput = true;
    buttonDownloaded.setUpdate(update);
    Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.ui_button_click, 1.0F));
    if (update.isDirectLink)
    {
        updateButton.displayString = I18n.translateToLocal(Strings.UPDATE);
        updateButton.enabled = update.updateURL != null && !update.isDownloaded();
    }
    else
    {
        updateButton.displayString = I18n.translateToLocal(Strings.OPEN_WEBPAGE);
        updateButton.enabled = update.updateURL != null;
    }
    if (openUpdate.changeLog != null)
    {
        changeLogList.setText(openUpdate.changeLog);
    }
    tempDisableButtonPress = 5;
}
 
Example #4
Source File: ItemOre.java    From ExNihiloAdscensio with MIT License 6 votes vote down vote up
@Override
public String getItemStackDisplayName(ItemStack stack) {
	String name = ore.getName();
	String pre = "";
	switch (stack.getItemDamage()) {
	case 0:
		pre = "orepiece";
		break;
	case 1:
		pre = "orehunk";
		break;
	case 2:
		pre = "oredust";
		break;
	case 3:
		pre = "oreingot";
		break;
	}
	return (StringUtils.capitalize(name) + " " +I18n.translateToLocal(pre+".name")).trim();
}
 
Example #5
Source File: Tooltips.java    From TinkersToolLeveling with MIT License 6 votes vote down vote up
private static String getRawLevelString(int level) {
  if(level <= 0) {
    return "";
  }

  // try a basic translated string
  if(I18n.canTranslate("tooltip.level." + level)) {
    return I18n.translateToLocal("tooltip.level." + level);
  }

  // ok. try to find a modulo
  int i = 1;
  while(I18n.canTranslate("tooltip.level." + i)) {
    i++;
  }

  // get the modulo'd string
  String str = I18n.translateToLocal("tooltip.level." + (level % i));
  // and add +s!
  for(int j = level / i; j > 0; j--) {
    str += '+';
  }

  return str;
}
 
Example #6
Source File: CraftServer.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
private void setVanillaCommands(boolean first) {
    Map<String, ICommand> commands = console.getCommandManager().getCommands();
    for (ICommand cmd : commands.values()) {
        commandMap.register("minecraft",
                new VanillaCommandWrapper((CommandBase) cmd, I18n.translateToLocal(cmd.getUsage(null))));
    }
}
 
Example #7
Source File: GuiUpdates.java    From VersionChecker with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void drawToolTip(int mouseX, int mouseY)
{
    if (updateButton.mousePressed(mc, mouseX, mouseY))
    {
        List<String> list = new ArrayList<String>();
        String left = openUpdate.updateURL;
        while(left != null)
        {
            String s = fontRenderer.trimStringToWidth(left, 200);
            list.add(s);
            if (s.length() == left.length())
            {
                break;
            }
            else
            {
                left = left.substring(s.length());
            }
        }
        this.drawHoveringText(list, mouseX, mouseY, fontRenderer);
    }
    else if (buttonDownloaded.mousePressed(mc, mouseX, mouseY))
    {
        this.drawHoveringText(Arrays.asList(I18n.translateToLocal(Strings.DL_MARKED_INFO).split(";")), mouseX, mouseY, fontRenderer);
    }
    else if (NEMButton.mousePressed(mc, mouseX, mouseY))
    {
        this.drawHoveringText(Arrays.asList(I18n.translateToLocal(Strings.TOGGLE_NEM_UPDATE).split(";")), mouseX, mouseY, fontRenderer);
    }
    else if (curseButton.mousePressed(mc, mouseX, mouseY))
    {
        this.drawHoveringText(Arrays.asList(I18n.translateToLocal(Strings.TOGGLE_CURSE_UPDATE).split(";")), mouseX, mouseY, fontRenderer);
    }
}
 
Example #8
Source File: GuiUpdates.java    From VersionChecker with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void drawScreen(int mouseX, int mouseY, float par3)
{
    updateList.drawScreen(mouseX, mouseY, par3);

    if (openUpdate != null)
    {
        changeLogList.drawScreen(mouseX, mouseY, par3);
    }

    this.fontRenderer.drawSplitString(I18n.translateToLocal(Strings.INFO).replace(";", "\n"), 10, height / 2 - 60, width / 2 - 150 + listShift - 20, 0xCCCCCC);

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    Minecraft.getMinecraft().renderEngine.bindTexture(Resources.GUI_LOGO);

    int i = width / 2 - 150 + listShift - 10;
    Gui.drawModalRectWithCustomSizedTexture(5, 5, 0, 0, i, (int) (i * 0.4), i, (int) (i * 0.4));

    if (openUpdate != null)
    {
        drawCenteredString(fontRenderer, openUpdate.displayName, width / 2 + listShift, height / 2 - 80, 0xFFFFFF);
        if (openUpdate.changeLog == null)
        {
            drawCenteredString(fontRenderer, I18n.translateToLocal(Strings.NO_CHANGE_LOG), width / 2 + listShift, height / 2 - 60, 0xCCCCCC);
        }
    }
    if (DownloadThread.isUpdating())
    {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        Minecraft.getMinecraft().renderEngine.bindTexture(Resources.GUI_ICONS);
        Gui.drawModalRectWithCustomSizedTexture(width - 20, 4, 0, 0, 16, 16, 64, 32);
    }

    super.drawScreen(mouseX, mouseY, par3);

    drawToolTip(mouseX, mouseY);
    if (tempDisableButtonPress > 0)
        tempDisableButtonPress--;
}
 
Example #9
Source File: GuiUpdates.java    From VersionChecker with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void initGui()
{
    IMCHandler.processMessages(FMLInterModComms.fetchRuntimeMessages(Reference.MOD_ID));
    super.initGui();

    windowStartX = width / 2 - 110 + listShift;
    windowStartY = height / 2 - 90;
    windowEndX = width / 2 + 110 + listShift;
    windowEndY = height / 2 + 70;

    buttonList.add(new GuiButton(0, width / 2 - 75 + listShift, height - 30, 150, 20, I18n.translateToLocal("gui.done")));

    buttonList.add(updateButton = new GuiButton(1, width / 2 - 100 + listShift, height / 2 + 40, 96, 20, I18n.translateToLocal(Strings.UPDATE)));

    buttonList.add(closeButton = new GuiButton(2, width / 2 + 4 + listShift, height / 2 + 40, 96, 20, I18n.translateToLocal("gui.done")));

    buttonList.add(new GuiButton(3, 10, height - 30, 150, 20, I18n.translateToLocal(Strings.MOD_FOLDER)));

    buttonList.add(buttonDownloaded = new GuiButtonDownloaded(4, width / 2 - 100 + listShift, height / 2 + 15));

    buttonList.add(NEMButton = new GuiButtonNEM(getUpdateListProperties(), 5, width / 2 + 90 + listShift, height - 30));
    buttonList.add(curseButton = new GuiButtonCurse(getUpdateListProperties(), 6, width / 2 + 125 + listShift, height - 30));

    updateList = new GuiUpdateList(this, 300, height - 60, 20, height - 40, width / 2 - 150 + listShift);
    changeLogList = new GuiChangeLogList(this, 200, 75, height / 2 - 60, height / 2 + 15, width / 2 - 100 + listShift);

    if (openUpdate != null)
    {
        openInfoScreen(openUpdate);
    }
    else
    {
        closeInfoScreen();
    }
}
 
Example #10
Source File: MetalToolEffects.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void addArmorSpecialPropertiesToolTip(MetalMaterial metal, java.util.List tooltipList){
	if(metal == Materials.adamantine){
		tooltipList.add(I18n.translateToLocal("tooltip.adamantine.armor").replace("%x", String.valueOf(4)));
	} else if(metal == Materials.aquarium){
		tooltipList.add(I18n.translateToLocal("tooltip.aquarium.armor").replace("%x", String.valueOf(4)));
	} else if(metal == Materials.coldiron){
		tooltipList.add(I18n.translateToLocal("tooltip.coldiron.armor").replace("%x", String.valueOf(3)));
	} else if(metal == Materials.mithril){
		tooltipList.add(I18n.translateToLocal("tooltip.mithril.armor"));
	} else if(metal == Materials.starsteel){
		tooltipList.add(I18n.translateToLocal("tooltip.starsteel.armor").replace("%x", String.valueOf(10)));
	}
}
 
Example #11
Source File: MetalToolEffects.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void addToolSpecialPropertiesToolTip(MetalMaterial metal, java.util.List tooltipList){
	if(metal == Materials.adamantine){
		tooltipList.add(I18n.translateToLocal("tooltip.adamantine.tool").replace("%x", String.valueOf(4)));
	} else if(metal == Materials.aquarium){
		tooltipList.add(I18n.translateToLocal("tooltip.aquarium.tool").replace("%x", String.valueOf(4)));
	} else if(metal == Materials.coldiron){
		tooltipList.add(I18n.translateToLocal("tooltip.coldiron.tool").replace("%x", String.valueOf(3)));
	} else if(metal == Materials.mithril){
		tooltipList.add(I18n.translateToLocal("tooltip.mithril.tool"));
	} else if(metal == Materials.starsteel){
		tooltipList.add(I18n.translateToLocal("tooltip.starsteel.tool").replace("%x", String.valueOf(10)));
	}
}
 
Example #12
Source File: CrusherRecipeHandler.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public String getRecipeName() {
	String key = "nei."+BaseMetals.MODID+".recipehandler.crusher.name";
	if(I18n.canTranslate(key)){
		return I18n.translateToLocal(key);
	} else {
		return "Crusher";
	}
}
 
Example #13
Source File: JEICrusherRecipeCategory.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public String getTitle() {
	String key = "nei."+BaseMetals.MODID+".recipehandler.crusher.name";
	if(I18n.canTranslate(key)){
		return I18n.translateToLocal(key);
	} else {
		return "Crusher";
	}
}
 
Example #14
Source File: BlockPackager.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public GuiBlueprint getGuiBlueprint(TileRoutiduct tile) {
	GuiBlueprint blueprint = new GuiBlueprint(tile).setSize(176, 241).setPlayerInvPos(7, 158);
	blueprint.addSlot(SlotType.NORMAL, 7, 30);
	blueprint.addSlot(SlotType.NORMAL, 25, 30);
	blueprint.addSlot(SlotType.NORMAL, 43, 30);
	blueprint.addSlot(SlotType.NORMAL, 7, 48);
	//		blueprint.addSlot(SlotType.NORMAL, 25, 48);
	blueprint.elements.add(new TextElement("Input", 4210752, 9, 21));
	blueprint.elements.add(new TextElement("Inventory", 4210752, 9, 149));
	blueprint.elements.add(new ElementBase(new Sprite(GuiAssemblerS.ROUTIDUCT_ELEMENTS, protocol.badgeX, protocol.badgeY, 15, 10), 154, 7));
	for (int i = 0; i < protocol.ports; i++)
		blueprint.elements.add(new ElementBase(Sprites.PACKAGE_BAR, 69, 21 + i * 11));
	blueprint.elements.add(new TextElement("Input", 4210752, 9, 21));
	blueprint.elements.add(new TextElement("100%", 0xFF000000, 25, 72, true));
	blueprint.elements.add(new ElementBase(Sprites.PROGRESS_BAR_BACKGROUND, 11, 81));
	for (Package.EnumColor color : Package.EnumColor.values()) {
		if (color.ordinal() < protocol.ports) {
			String text = I18n.translateToLocal(color.unlocalisedName) + " Package";
			String number = (color.ordinal() + 1) + ".";
			blueprint.elements.add(new TextElement(number, 0xFFC4C4C4, 78, 23 + color.ordinal() * 11, true));
			blueprint.elements.add(new TextElement(I18n.translateToLocal(color.unlocalisedName) + " Package", color.colour, 86, 23 + color.ordinal() * 11, 74));
			blueprint.elements.add(new ElementBase(new Sprite(GuiAssemblerS.ROUTIDUCT_ELEMENTS, 26, color.textureY, 8, 6), 159, 24 + color.ordinal() * 11));
		}
	}
	blueprint.elements.add(new ElementBase(new Sprite(GuiAssemblerS.ROUTIDUCT_ELEMENTS, 0, Package.EnumColor.values()[protocol.ports].textureY, 26, 6), 12, 82));
	return blueprint;
}
 
Example #15
Source File: ItemJar.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public String getItemStackDisplayName(ItemStack stack) {
	if (stack.getItemDamage() == 2) {
		FairyData fairy = FairyData.deserialize(NBTHelper.getCompound(stack, "fairy"));
		if (fairy == null) return super.getItemStackDisplayName(stack);

		IManaCapability cap = fairy.handler;
		double mana = ManaManager.getMana(cap) / ManaManager.getMaxMana(cap);
		boolean dulled = fairy.isDepressed;

		if (dulled) {
			return I18n.translateToLocal("item.wizardry.fairy_jar.dulled.name").trim();
		} else if (mana > 0.25 && mana < 0.5) {
			return I18n.translateToLocal("item.wizardry.fairy_jar.barely_excited.name").trim();

		} else if (mana >= 0.5 && mana < 0.75) {
			return I18n.translateToLocal("item.wizardry.fairy_jar.moderately_excited.name").trim();

		} else if (mana > 0.75 && mana < 1) {
			return I18n.translateToLocal("item.wizardry.fairy_jar.very_excited.name").trim();

		} else if (mana >= 1) {
			return I18n.translateToLocal("item.wizardry.fairy_jar.overloaded.name").trim();

		} else return super.getItemStackDisplayName(stack);

	} else return super.getItemStackDisplayName(stack);
}
 
Example #16
Source File: ItemJar.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag
		flagIn) {
	if (stack.getItemDamage() == 2) {
		FairyData fairy = FairyData.deserialize(NBTHelper.getCompound(stack, "fairy"));
		if (fairy == null) return;

		IManaCapability cap = fairy.handler;
		double mana = ManaManager.getMana(cap) / ManaManager.getMaxMana(cap);
		boolean dulled = fairy.isDepressed;

		if (dulled) {
			tooltip.add(I18n.translateToLocal("item.wizardry.fairy_jar.dulled.info").trim());
		} else if (mana > 0.25 && mana < 0.5) {
			tooltip.add(I18n.translateToLocal("item.wizardry.fairy_jar.barely_excited.info").trim());

		} else if (mana >= 0.5 && mana < 0.75) {
			tooltip.add(I18n.translateToLocal("item.wizardry.fairy_jar.moderately_excited.info").trim());

		} else if (mana > 0.75 && mana < 1) {
			tooltip.add(I18n.translateToLocal("item.wizardry.fairy_jar.very_excited.info").trim());

		} else if (mana >= 1) {
			tooltip.add(I18n.translateToLocal("item.wizardry.fairy_jar.overloaded.info").trim());

		} else super.addInformation(stack, worldIn, tooltip, flagIn);

	} else super.addInformation(stack, worldIn, tooltip, flagIn);
}
 
Example #17
Source File: MessageEUStorage.java    From Production-Line with MIT License 5 votes vote down vote up
@Override
protected IMessage handlerMessage(MessageBase message, MessageContext ctx) {
    long pos = message.nbt.getLong("pos");
    short modeID = message.nbt.getShort("redstoneMode");
    RedstoneMode mode = RedstoneMode.values()[modeID];
    TileEUStorage tile = (TileEUStorage) ctx.getServerHandler().playerEntity.world.getTileEntity(BlockPos.fromLong(pos));
    tile.redstoneMode = mode;
    PLUtil.messageToPlayer(ctx.getServerHandler().playerEntity, I18n.translateToLocal("ic2.EUStorage.gui.mod.redstone" + modeID));
    return null;
}
 
Example #18
Source File: IMCHandler.java    From VersionChecker with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void processCurseCheckMessage(String sender, NBTTagCompound tag)
{
    if (tag.hasKey(IMCOperations.CURSE_PROJECT_NAME) && tag.hasKey(IMCOperations.CURSE_FILENAME_PARSER))
    {
        String curseProjectName = tag.getString(IMCOperations.CURSE_PROJECT_NAME);
        String latestFilename = WebHelper.getLatestFilenameFromCurse("http://minecraft.curseforge.com/projects/" + curseProjectName + "/files/latest");
        if (latestFilename != null)
        {
            String fileNameParser = tag.getString(IMCOperations.CURSE_FILENAME_PARSER);
            int i = fileNameParser.indexOf('[');
            int o = fileNameParser.indexOf(']');
            if (i != -1 && o != -1)
            {
                String version = latestFilename.replace(fileNameParser.substring(0, i), "").replace(fileNameParser.substring(o + 1, fileNameParser.length()), "");

                if (version.equals(tag.hasKey(IMCOperations.OLD_VERSION) ? tag.getString(IMCOperations.OLD_VERSION) : ModHelper.getModContainer(sender).getVersion()))
                    return;

                Update update = new Update(sender);

                update.newVersion = version;
                update.updateURL = "http://minecraft.curseforge.com/projects/" + curseProjectName + "/files/latest";
                update.isDirectLink = true;
                update.newFileName = latestFilename;
                update.changeLog = I18n.translateToLocal(Strings.CURSE_UPDATE);

                if (tag.hasKey(IMCOperations.MOD_DISPLAY_NAME))
                {
                    update.displayName = tag.getString(IMCOperations.MOD_DISPLAY_NAME);
                }
                else
                {
                    update.displayName = ModHelper.getModContainer(sender).getName();
                }

                if (tag.hasKey(IMCOperations.OLD_VERSION))
                {
                    update.oldVersion = tag.getString(IMCOperations.OLD_VERSION);
                }
                else
                {
                    update.oldVersion = ModHelper.getModContainer(sender).getVersion();
                }

                update.updateType = Update.UpdateType.CURSE;

                UpdateHandler.addUpdate(update);
                return;
            }
        }
    }
    LogHandler.error(String.format("An error was encountered when fetching latest version from Curse for %s!", sender));
}
 
Example #19
Source File: TranslationUtils.java    From OpenModsLib with MIT License 4 votes vote down vote up
public static String translateToLocalFormatted(String key, Object... args) {
	return I18n.translateToLocalFormatted(key, args);
}
 
Example #20
Source File: TranslationUtils.java    From OpenModsLib with MIT License 4 votes vote down vote up
public static String translateToLocal(String key) {
	return I18n.translateToLocal(key);
}
 
Example #21
Source File: GuiUpdateList.java    From VersionChecker with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected void drawSlot(int slotIndex, int minX, int maxX, int minY, int maxY, Tessellator tesselator)
{
    Update update = updateList.get(slotIndex);
    if (update != null && !update.oldVersion.matches(update.newVersion))
    {
        this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(update.displayName, listWidth - 10), minX + 5, minY + 4, 0xFFFFFF);
        if (this.parent.getFontRenderer().getStringWidth(update.newVersion) >= (listWidth - 125)){
        	this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(update.oldVersion + " -> ", listWidth - 10), minX + 5, minY + 15, 0xCCCCCC);
        	this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("  " + update.newVersion, listWidth - 10), minX + 5, minY + 25, 0xCCCCCC);
        }
        else
        {
        	this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(update.oldVersion + " -> " + update.newVersion, listWidth - 10), minX + 5, minY + 15, 0xCCCCCC);
        }
        
        String info;

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        Minecraft.getMinecraft().renderEngine.bindTexture(Resources.GUI_ICONS);

        if (DownloadThread.isUpdating(update))
        {
            Gui.drawModalRectWithCustomSizedTexture(maxX - 30, minY + 8, 0, 0, 16, 16, 64, 32);

            info = I18n.translateToLocal(Strings.UPDATING);
        }
        else if (update.isDownloaded())
        {
            Gui.drawModalRectWithCustomSizedTexture(maxX - 30, minY + 8, 16, 0, 16, 16, 64, 32);

            if (!update.MOD_ID.equalsIgnoreCase(Reference.MOD_ID))
            {
                info = I18n.translateToLocal(Strings.IS_DOWNLOADED);
            }
            else
            {
                info = I18n.translateToLocal(Strings.UNABLE_TO_REMOVE_SELF);
            }
        }
        else if (update.isErrored())
        {
            Gui.drawModalRectWithCustomSizedTexture(maxX - 30, minY + 8, 32, 0, 16, 16, 64, 32);

            info = I18n.translateToLocal(Strings.ERRORED);
        }
        else if (update.isDirectLink)
        {
            Gui.drawModalRectWithCustomSizedTexture(maxX - 30, minY + 8, 16, 16, 16, 16, 64, 32);

            info = I18n.translateToLocal(Strings.DL_AVAILABLE);
        }
        else if (update.updateURL != null)
        {
            Gui.drawModalRectWithCustomSizedTexture(maxX - 30, minY + 8, 0, 16, 16, 16, 64, 32);

            info = I18n.translateToLocal(Strings.LINK_TO_DL);
        }
        else
        {
            info = I18n.translateToLocal(Strings.CANNOT_UPDATE);
        }

        if (update.updateType == Update.UpdateType.NOT_ENOUGH_MODS)
        {
            Gui.drawModalRectWithCustomSizedTexture(maxX - 30, minY + 8, 32, 16, 16, 16, 64, 32);
        }
        else if (update.updateType == Update.UpdateType.CURSE)
        {
            Gui.drawModalRectWithCustomSizedTexture(maxX - 30, minY + 8, 48, 0, 16, 16, 64, 32);
        }

        this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(info, listWidth - 10), minX + 5, minY + 35, 0xCCCCCC);
    }
}
 
Example #22
Source File: Tooltips.java    From TinkersToolLeveling with MIT License 4 votes vote down vote up
private static String getXpToolTip(int xp, int xpNeeded) {
  return String.format("%s: %s", I18n.translateToLocal("tooltip.xp"), getXpString(xp, xpNeeded));
}
 
Example #23
Source File: Tooltips.java    From TinkersToolLeveling with MIT License 4 votes vote down vote up
private static String getLevelTooltip(int level) {
  return String.format("%s: %s", I18n.translateToLocal("tooltip.level"), getLevelString(level));
}
 
Example #24
Source File: LocalizedException.java    From LunatriusCore with MIT License 4 votes vote down vote up
public LocalizedException(final String format, final Object... arguments) {
    super(I18n.translateToLocalFormatted(format, arguments));
}
 
Example #25
Source File: LocalizedException.java    From LunatriusCore with MIT License 4 votes vote down vote up
public LocalizedException(final String format) {
    super(I18n.translateToLocal(format));
}
 
Example #26
Source File: CommonProxy.java    From EnderZoo with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
public String translate(String unlocalized) {
 return I18n.translateToLocal(unlocalized);
}
 
Example #27
Source File: LocalizationHelper.java    From Moo-Fluids with GNU General Public License v3.0 4 votes vote down vote up
public static String localize(final String unlocalizedString, final boolean prependPrefix) {
  return prependPrefix ? I18n.translateToLocal(PREFIX + unlocalizedString)
                       : I18n.translateToLocal(unlocalizedString);
}
 
Example #28
Source File: ItemSorter.java    From NotEnoughItems with MIT License 4 votes vote down vote up
public String getLocalisedName() {
    return I18n.translateToLocal(name);
}
 
Example #29
Source File: ItemSorter.java    From NotEnoughItems with MIT License 4 votes vote down vote up
public String getTooltip() {
    String tipname = name + ".tip";
    String tip = I18n.translateToLocal(tipname);
    return !tip.equals(tipname) ? tip : null;
}
 
Example #30
Source File: GuiOptionPane.java    From NotEnoughItems with MIT License 4 votes vote down vote up
@Override
public void addWidgets() {
    add(pane = new ScrollPane());
    add(backButton = new GuiCCButton(0, 0, 0, 20, I18n.translateToLocal("nei.options.back")).setActionCommand("back"));
    initGui();
}