Locale split

This commit is contained in:
Michal Srutek 2023-12-21 08:22:55 +01:00
parent e50278a35e
commit 621d3fa040

View File

@ -52,10 +52,10 @@ public class PlatformUtil extends ChannelDelegateImpl {
if (locale == null) {
return Locale.US;
}
String[] localeSplitted = locale.split("_");
String language = localeSplitted[0];
String country = localeSplitted.length > 1 ? localeSplitted[1] : "";
String variant = localeSplitted.length > 2 ? localeSplitted[2] : "";
String[] localeSplit = locale.split("_");
String language = localeSplit[0];
String country = localeSplit.length > 1 ? localeSplit[1] : "";
String variant = localeSplit.length > 2 ? localeSplit[2] : "";
return new Locale(language, country, variant);
}