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

  • Author

Thanks! What I want to do is have a few localisations such as metal.tin and metal.copper, and match them with component.plate and component.powder, so I can combine them to make Tin Plate, Tin Powder, Copper Plate, Copper Powder, etc.

Mixing and matching like that isnt advised because other languages have different syntaxes so its not always {Material} {Form}

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team onย Patreon

What Lex says is very true, but don't let that discourage you - translations can be very flexible with just a little bit of formatting, as they ultimately use the Java Formatter class:

// Lang file:
yourmod.item.name=%s %s // results in "Tin Plate"
yourmod.metal.tin.name=Tin
yourmod.component.plate.name=Plate

// Item code:
@Override
public String getItemStackDisplayName(ItemStack stack) {
// Make sure to use #translateToLocalFormatted and pass the translations for each component as an argument
return StatCollector.translateToLocalFormatted(getUnlocalizedName() + ".name",
ย  StatCollector.translateToLocal("yourmod.metal.tin.name"),
ย  StatCollector.translateToLocal("yourmod.component.plate.name"));

Of course, it's up to you to determine which metal and component to use in the translation, probably using some kind of Object retrieved from NBT. But anyway, then languages with different ordering rules can translate it like so:

// taking advantage of Formatter syntax to re-order the arguments:
yourmod.item.name=%2$s %1$sย  // results in "Plate Tin"

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.