I have all my ResourceBundle values in a table and formatted as per requirement. I have to change the languages on the website based on user selection in a drop
As of Java8, initializing the locale should be done using the language tag en-US. Locale.forLanguageTag("en-US").toString(); returns the output: en_US
Where as Locale.forLanguageTag("en_US") does not create the required locale. It will default to the system locale.
Locale.forLanguageTag("en_US").toString() returns null