One resource bundle per One Application - I18n and L10n will be easy
By Mahipalsinh Rana on Aug 13, 2008
First what is with this some what mystry title.
In simple words , I would like to highlight advantage of keeping only one resource bundle( aka. one property file which contains all the localizable messages) per One Application.
Source of insipiration was Liferay.
Let me give you more idea of how it will look like.
1) Make sure all your translatable strings are put on one property file ex. Language.properties
will help to your customer who might want to add new langauge or want
to add new strings to existing language or change strings to existing
langauge. Easy to find where to do localization.
2) Organized it well . Define a rule to write key name.
ex. first_name=First Name
This will help to easily find of what this key represents in localized bundle.
3) Keep it in Alphabetical order
This will ensure that duplicate properties does not exists in your bundle.
4) Now you can keep common utility class which will load the bundle based on Locale user wanted
This will help all your other class as they do not need to bother about loading bundle. They can focus on solving business logic (that's where money comes from)Last but not the least ... Innovation is mother of all invension ... so innovate whether it is necessasity or not :-) ...