Posted October 20, 20177 yr I would like to have item information with addInformation() but have it localized. I've tried with tooltip.add(ChatFormatting.DARK_PURPLE + "descr.bonus.hoe"); but is not working Edited October 20, 20177 yr by Insane96MCP
October 20, 20177 yr That's because you have 3 minutes ago, Insane96MCP said: ChatFormatting.DARK_PURPLE Which requires you to the color code in your lang file, remove it. To make it have colors you put § + a number in front of the 'translation'. Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
October 20, 20177 yr Either use a TextComponentTranslation or translate using I18n. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 20, 20177 yr 1 minute ago, Kokkie said: That's because you have Which requires you to the color code in your lang file, remove it. To make it have colors you put § + a number in front of the 'translation'. Wrong. Tooltip entries are not translated when displayed, you have to do it yourself. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 20, 20177 yr Just now, Draco18s said: Wrong. Tooltip entries are not translated when displayed, you have to do it yourself. But still, if he would pass it as a string to translate he would have to remove that, or make them seperate Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
October 20, 20177 yr 2 minutes ago, Kokkie said: But still, if he would pass it as a string to translate he would have to remove that, or make them seperate No. tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("tooltip:oreflowers:indicator")); Edited October 20, 20177 yr by Draco18s Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 20, 20177 yr Just now, Draco18s said: No. tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("tooltip:oreflowers:april.one")); That's what I ment with 2 minutes ago, Kokkie said: or make them seperate Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
October 20, 20177 yr 1 minute ago, Kokkie said: That's what I ment with Quote or make them seperate Oh no, the horror of having to use a + and concatenate a string! Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
November 1, 20177 yr Author On 20/10/2017 at 8:46 PM, Draco18s said: No. tooltip.add(TextFormatting.LIGHT_PURPLE + I18n.format("tooltip:oreflowers:indicator")); Thanks everyone. I18n did the job. Another small question. How can I add a space after a string in the lang file? Like tooltip.item.base_info=This is an OP sword <-Space Seems like minecraft doesn't recognize the space. Nevermind. I'm stupid. ^ The same question goes for a space after the equal (=) tooltip.item.base_info= This is an OP sword In this case, minecraft doesn't recognize the string at all. I had to do tooltip.add(I18n.format("tooltip.item.base_info") + " "); and tooltip.add(" " + I18n.format("tooltip.item.base_info")); but I don't think that is a neat solution Edited November 1, 20177 yr by Insane96MCP I'm blind
November 1, 20177 yr Author 31 minutes ago, diesieben07 said: You should't need to have spaces at the beginning of your translation. Do not ever add translations together in code, always do it via the language file with placeholders. Oh, forgot about placeholders.
November 1, 20177 yr Author 35 minutes ago, diesieben07 said: You should't need to have spaces at the beginning of your translation. Do not ever add translations together in code, always do it via the language file with placeholders. There's any convention I should use for placeholders?
November 1, 20177 yr Author 9 minutes ago, diesieben07 said: Not sure what you mean. Nevermind. Found out that I can use %d / %s / ... and the parameters parameter in I18n.format()
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.