mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-24 14:33:17 +02:00
Locale.forLanguageTag instead of deprecated 'new Locale'
This commit is contained in:
@@ -735,15 +735,14 @@ public class Utils {
|
|||||||
public static ResourceBundle getResourceBundle(String langSelect) {
|
public static ResourceBundle getResourceBundle(String langSelect) {
|
||||||
if (langSelect == null) {
|
if (langSelect == null) {
|
||||||
if (!getConfigString("lang", "").equals("")) {
|
if (!getConfigString("lang", "").equals("")) {
|
||||||
String[] langCode = getConfigString("lang", "").split("_");
|
|
||||||
LOGGER.info("Setting locale to " + getConfigString("lang", ""));
|
LOGGER.info("Setting locale to " + getConfigString("lang", ""));
|
||||||
return ResourceBundle.getBundle("LabelsBundle", new Locale(langCode[0], langCode[1]),
|
return ResourceBundle.getBundle("LabelsBundle", Locale.forLanguageTag(getConfigString("lang", "")),
|
||||||
new UTF8Control());
|
new UTF8Control());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String[] langCode = langSelect.split("_");
|
String[] langCode = langSelect.split("_");
|
||||||
LOGGER.info("Setting locale to " + langSelect);
|
LOGGER.info("Setting locale to " + langSelect);
|
||||||
return ResourceBundle.getBundle("LabelsBundle", new Locale(langCode[0], langCode[1]), new UTF8Control());
|
return ResourceBundle.getBundle("LabelsBundle", Locale.forLanguageTag(langSelect), new UTF8Control());
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
LOGGER.info("Setting locale to default");
|
LOGGER.info("Setting locale to default");
|
||||||
|
Reference in New Issue
Block a user