Reputation: 2926
Suppose I have Locale enUS = new Locale("en", "US");
. Is there a way to extract the language locale from it, better/nicer than Locale en = new Locale(enUS.getLanguage());
?
Upvotes: 1
Views: 148
Reputation: 15628
Although I don't find the above too verbose myself commons.lang's LocaleUtils
may look cleaner:
LocaleUtils.toLocale(enUS.getLanguage());
Upvotes: 4