Jump to content

Recommended Posts

Posted

How can I let a book use a translation from I18n?

or How can get I18n translation from local when it's a server?

I use it for books.

And please excuse my poor English.

Posted

Translation should only be done on the client. If you translate on a server it will 1) only translate to English and 2) send the English text to the client. You can translate a string with TextComponentTranslation or I18n.format

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

An API for what

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

What do you mean

  On 3/25/2019 at 12:45 PM, Taskkill said:

A book which can translate from I18n...

Expand  

? I18n is an API for internationalising messages.

 

  On 3/25/2019 at 11:49 AM, diesieben07 said:

Vanilla books don't support this. You can do it yourself using TextComponentTranslation.

Expand  

 

  On 3/25/2019 at 12:02 PM, Cadiboo said:

I18n.format

Expand  

 

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 3/25/2019 at 12:02 PM, Cadiboo said:

I18n.format

Expand  

That method formats/translates a translation key. Example: item.dirt.name -> Dirt.

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 3/25/2019 at 12:53 PM, Cadiboo said:

That method formats/translates a translation key. Example: item.dirt.name -> Dirt.

Expand  

I know. You don't understand what I mean. Maybe It's because of my poor English.

The book, just when I open it, it'll read the I18n keys and automatically translate to the content.

Posted (edited)
  On 3/25/2019 at 12:58 PM, Taskkill said:

The book, just when I open it, it'll read the I18n keys and automatically translate to the content.

Expand  

There is nothing you can do about translating vanilla books.

The content of vanilla books are stored in the NBT of the stack, and the book will not auto-localize its content when opened by a player.

You can, however, create your own custom item book that opens a custom GUI when right clicked in hand. This will allow you to add translations.

 

  On 3/25/2019 at 11:40 AM, Taskkill said:

or How can get I18n translation from local when it's a server?

Expand  

Doing so doesn't make much sense, as the sole purpose of localizations is to allow client-specific translation.

Edited by DavidM

Some tips:

  Reveal hidden contents

 

Posted (edited)
  On 3/25/2019 at 10:51 PM, fcelon said:

There is. Every text component in vanilla minecraft can be translated. You need to set the translate string in book page text nbt to translation key. https://minecraft.gamepedia.com/Commands#Raw_JSON_text

Expand  

He meant translating book content on the client side.

the content of a vanilla book always stays the same can cannot be localized client-wise.

Edited by DavidM

Some tips:

  Reveal hidden contents

 

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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