calclavia Posted November 23, 2012 Share Posted November 23, 2012 How would I create language files and use them so my mod can be used in multiple languages? Quote http://calclavia.com/uploads/banner.png[/img] Link to comment Share on other sites More sharing options...
SanAndreaP Posted November 23, 2012 Share Posted November 23, 2012 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. Quote 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 More sharing options...
calclavia Posted November 23, 2012 Author Share Posted November 23, 2012 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. I'm looking for a native way to do it with just Forge. Railcraft seems to be able to achieve this. Quote http://calclavia.com/uploads/banner.png[/img] Link to comment Share on other sites More sharing options...
N1xx1 Posted November 23, 2012 Share Posted November 23, 2012 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 Quote Link to comment Share on other sites More sharing options...
calclavia Posted November 23, 2012 Author Share Posted November 23, 2012 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? Quote http://calclavia.com/uploads/banner.png[/img] Link to comment Share on other sites More sharing options...
N1xx1 Posted November 23, 2012 Share Posted November 23, 2012 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. Quote Link to comment Share on other sites More sharing options...
keepcalm Posted November 24, 2012 Share Posted November 24, 2012 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 Quote 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! http://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 More sharing options...
calclavia Posted November 24, 2012 Author Share Posted November 24, 2012 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... Quote http://calclavia.com/uploads/banner.png[/img] Link to comment Share on other sites More sharing options...
Recommended Posts
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.