mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8206886: Java does not set the default format locale correctly on mac10.13
Reviewed-by: rriggs
This commit is contained in:
parent
f921743302
commit
602a497270
1 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -45,11 +45,22 @@ char *getPosixLocale(int cat) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LOCALEIDLENGTH 128
|
#define LOCALEIDLENGTH 128
|
||||||
|
#ifndef kCFCoreFoundationVersionNumber10_11_Max
|
||||||
|
#define kCFCoreFoundationVersionNumber10_11_Max 1299
|
||||||
|
#endif
|
||||||
char *getMacOSXLocale(int cat) {
|
char *getMacOSXLocale(int cat) {
|
||||||
const char* retVal = NULL;
|
const char* retVal = NULL;
|
||||||
char languageString[LOCALEIDLENGTH];
|
char languageString[LOCALEIDLENGTH];
|
||||||
char localeString[LOCALEIDLENGTH];
|
char localeString[LOCALEIDLENGTH];
|
||||||
|
|
||||||
|
// Since macOS 10.12, there is no separate language selection for
|
||||||
|
// "format" locale, e.g., date format. Use the preferred language
|
||||||
|
// for all LC_* categories.
|
||||||
|
if (kCFCoreFoundationVersionNumber >
|
||||||
|
kCFCoreFoundationVersionNumber10_11_Max) {
|
||||||
|
cat = LC_MESSAGES;
|
||||||
|
}
|
||||||
|
|
||||||
switch (cat) {
|
switch (cat) {
|
||||||
case LC_MESSAGES:
|
case LC_MESSAGES:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue