I am planning to make a website written in JSP/Java available in multiple languages, now I wonder how I would do that in a nice manner, currently I got one proposal as approach, but I also wonder if something else is possible.
The proposal: Have a class Language.java responsible for managing the language, preferably the data itself should be stored in for example .txt files, atleast some simple format that others (possibly non-programming related) can also work with.
Very basic setup:
english.lang:
RegisterUsername => Username
RegisterPassword => Password
RegisterPasswordConfirmed => Confirm password
Calling code:
Language language = new Language();
//constructor of Language should determine what language to use
System.out.println(Language.get("RegisterUsername"));
//would show the string in the respective language
Second thought: Some code like ${RegisterUserName}
would even be more handy, but I'm afraid that this is not possible.
How should I implement the internatiolization?
Regards.