Merge pull request #2022 from ManfredKarrer/fix-missing-country-in-locale

Use en_US if default locale has no country defined.
This commit is contained in:
Christoph Atteneder 2018-12-01 07:32:07 +01:00 committed by GitHub
commit 99e7c670ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,11 +25,18 @@ import java.util.Locale;
public class GlobalSettings {
private static boolean useAnimations = true;
private static Locale locale = Locale.getDefault();
private static Locale locale;
private static final ObjectProperty<Locale> localeProperty = new SimpleObjectProperty<>(locale);
private static TradeCurrency defaultTradeCurrency;
private static String btcDenomination;
static {
locale = Locale.getDefault();
// On some systems there is not country defined, in that case we use en_US
if (locale.getCountry() == null || locale.getCountry().isEmpty())
locale = Locale.US;
}
public static void setLocale(Locale locale) {
GlobalSettings.locale = locale;