Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by Insane96MCP

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

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.

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.

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

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 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.

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

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.

  • 2 weeks later...
  • 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 by Insane96MCP
I'm blind

  • 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.

  • 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?

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.