Since 1.7.2 has recently gotten a well mapped version of Forge with it, I figured I'd post this tutorial to aid with a common problem with the new update. With Forge, you'll notice that LanguageRegistry.addName() has been deprecated. Luckily, the new way to localize isn't very hard and only requires the creation of one file.
The rest of this tutorial is going to assume that you are using Eclipse. Open up the package explorer(It's in the upper left side of the screen and right click the src/main/java package. Then go to New, select package, and name it, assets.yourmodid.lang. Right click the newly created package and select new file and name it the language you want to have your mod localized in, and give it a .lang extension. For example, if I wanted to localize my block and item names in American English I would name my file en_US.lang.
Now for the localizations for blocks(Note you can have spaces in your unlocalized name, Ex: itemGroup.Your Tab=Your Tab):
tile.yourblocksunlocalizedname.name=Your Block
For Items:
item.youritemsunlocalizedname.name=Your Item
For Creative Tabs:
itemGroup.yourtabsname=Your Tabs Name
For entities:
entity.YourMod.YourEntityName.name=Your Entity
I hope this tutorial was able to solve all of your localization needs! Leave a reply if you need help with anything.
The rest of this tutorial is going to assume that you are using Eclipse. Open up the package explorer(It's in the upper left side of the screen and right click the src/main/java package. Then go to New, select package, and name it, assets.yourmodid.lang. Right click the newly created package and select new file and name it the language you want to have your mod localized in, and give it a .lang extension. For example, if I wanted to localize my block and item names in American English I would name my file en_US.lang.
Now for the localizations for blocks(Note you can have spaces in your unlocalized name, Ex: itemGroup.Your Tab=Your Tab):
For Items:
For Creative Tabs:
For entities:
I hope this tutorial was able to solve all of your localization needs! Leave a reply if you need help with anything.
You cannot use LanguageRegistry.addName() anymore. Actually follow the tutorial.
And LanguageRegistry is gone now. Use lang files, en_US.lang for instance.
Posting the same code over and over again isn't going to do anything. Follow the tutorial.
The tutorial tells you all of the steps you need to take. The localizations do not go into your block file, they go in a separate file.
No problem!