summaryrefslogtreecommitdiff
path: root/sal/osl/unx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-03-05 15:55:09 +0200
committerTor Lillqvist <tml@collabora.com>2014-03-05 16:06:19 +0200
commit07b35e16c1f6d082fa304035155f2ef6afe789aa (patch)
tree6b82e2f64412e385242b9cc40782f2e67eb7ac25 /sal/osl/unx
parent3184f539b0bb4e7df6189248fb33804916259d9d (diff)
Use the AppleLanguages preference instead of AppleLocale on OS X and iOS
AppleLocale is for things like date formats, it seems, while the first entry in AppleLanguages contains the user's preferred UI language. I think that is closer to what we want here. Note that in AppleLanguages, the country (where present) is separated from the language with a hyphen, while in AppleLocale an underscore is used. Change-Id: I6d8a728d53ca6b46e8fcf0e333a6d0aa34abff1d
Diffstat (limited to 'sal/osl/unx')
-rw-r--r--sal/osl/unx/osxlocale.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sal/osl/unx/osxlocale.cxx b/sal/osl/unx/osxlocale.cxx
index 8b7c4b5bed44..0d9397cd0912 100644
--- a/sal/osl/unx/osxlocale.cxx
+++ b/sal/osl/unx/osxlocale.cxx
@@ -48,7 +48,7 @@ namespace
*/
CFStringRef getProcessLocale()
{
- CFPropertyListRef pref = CFPreferencesCopyAppValue(CFSTR("AppleLocale"), kCFPreferencesCurrentApplication);
+ CFPropertyListRef pref = CFPreferencesCopyAppValue(CFSTR("AppleLanguages"), kCFPreferencesCurrentApplication);
CFPropertyListGuard proplGuard(pref);
if (pref == NULL) // return fallback value 'en_US'
@@ -72,7 +72,7 @@ int macosx_getLocale(char *locale, sal_uInt32 bufferLen)
// split the string into substrings; the first two (if there are two) substrings
// are language and country
- CFArrayRef subs = CFStringCreateArrayBySeparatingStrings(NULL, sref, CFSTR("_"));
+ CFArrayRef subs = CFStringCreateArrayBySeparatingStrings(NULL, sref, CFSTR("-"));
CFArrayGuard arrGuard(subs);
CFStringRef lang = (CFStringRef)CFArrayGetValueAtIndex(subs, 0);