Posted November 23, 201212 yr How would I create language files and use them so my mod can be used in multiple languages? http://calclavia.com/uploads/banner.png[/img]
November 23, 201212 yr 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.
November 23, 201212 yr Author 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. http://calclavia.com/uploads/banner.png[/img]
November 23, 201212 yr 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
November 23, 201212 yr Author 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? http://calclavia.com/uploads/banner.png[/img]
November 23, 201212 yr 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.
November 24, 201212 yr 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! http://bit.ly/HZ03zy[/img] Tired of waiting for mods to port to bukkit? use BukkitForge! (now with a working version of WorldEdit!)
November 24, 201212 yr Author 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... http://calclavia.com/uploads/banner.png[/img]
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.