mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
properties: do not add redundant "_" to suffix
This commit is contained in:
+10
-1
@@ -152,7 +152,16 @@ public class PropertiesUtil {
|
||||
final String language = splitRawLocale[1];
|
||||
final String country = splitRawLocale.length > 2 ? splitRawLocale[2] : "";
|
||||
final String variant = splitRawLocale.length > 3 ? splitRawLocale[3] : "";
|
||||
return Pair.create(new Locale(language, country, variant), language + "_" + country + "_" + variant);
|
||||
|
||||
StringBuilder trimmedSuffix = new StringBuilder(language);
|
||||
if (!country.isEmpty()) {
|
||||
trimmedSuffix.append("_").append(country);
|
||||
}
|
||||
if (!variant.isEmpty()) {
|
||||
trimmedSuffix.append("_").append(variant);
|
||||
}
|
||||
|
||||
return Pair.create(new Locale(language, country, variant), trimmedSuffix.toString());
|
||||
}
|
||||
}
|
||||
return Pair.create(DEFAULT_LOCALE, "");
|
||||
|
||||
Reference in New Issue
Block a user