Jump to content

Languages


calclavia

Recommended Posts

How would I create language files and use them so my mod can be used in multiple languages?

 

My Manager Pack can do this. I just have to put the source up.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

You can easily do that with a new configuration.

 

String translated = config.get("language", "myblock1", "My Block").value;

 

So you can switch beetwen different configuration files depending on Language you choose.

 

 

If you want to get current language:

 

FMLClientHandler.instance().getClient().gameSettings.language

Link to comment
Share on other sites

You can easily do that with a new configuration.

 

String translated = config.get("language", "myblock1", "My Block").value;

 

So you can switch beetwen different configuration files depending on Language you choose.

 

 

If you want to get current language:

 

FMLClientHandler.instance().getClient().gameSettings.language

 

That's not what I mean. I want to set up something like a language file which I can switch my mod to using. Like this: https://github.com/CovertJaguar/Railcraft-Localization

 

How would I, from that file apply all those language settings into my blocks and items?

Link to comment
Share on other sites

That's not what I mean. I want to set up something like a language file which I can switch my mod to using. Like this: https://github.com/CovertJaguar/Railcraft-Localization

 

How would I, from that file apply all those language settings into my blocks and items?

 

Well that's the same.... You have to change the name you assing depending on translated value.

 

 

Ok, I think I'll make something later to show you what I mean.

Link to comment
Share on other sites

This might interest you: https://github.com/SirSengir/BuildCraft/blob/master/common/buildcraft/core/utils/Localization.java

It simply loads a properties file, en_US.properties, for example, and reads the keys from that. An example of a properties file is: https://github.com/SirSengir/BuildCraft/blob/master/buildcraft_resources/lang/buildcraft/en_US.properties

Protip: try and find answers yourself before asking on the forum.

It's pretty likely that there is an answer.

 

Was I helpful? Give me a thank you!

 

 

width=635 height=903http://bit.ly/HZ03zy[/img]

 

 

Tired of waiting for mods to port to bukkit?

use BukkitForge! (now with a working version of WorldEdit!)

Link to comment
Share on other sites

This might interest you: https://github.com/SirSengir/BuildCraft/blob/master/common/buildcraft/core/utils/Localization.java

It simply loads a properties file, en_US.properties, for example, and reads the keys from that. An example of a properties file is: https://github.com/SirSengir/BuildCraft/blob/master/buildcraft_resources/lang/buildcraft/en_US.properties

Thanks! That's what I was looking for...
Link to comment
Share on other sites

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.