Permalink
Browse files

* Enable preferences for bundles.

* Correct Windows handling of user preferred language ID.


git-svn-id: https://opencflite.svn.sourceforge.net/svnroot/opencflite@113 949b7c4e-b822-e185-8c53-f993a654f32e
  • Loading branch information...
1 parent 7e1a6bf commit f2f99087a95c3ccdd6c2c2fb87ae831c1ce83bf2 bfulgham committed Feb 21, 2009
Showing with 3 additions and 4 deletions.
  1. +1 −1 CFBundle_Resources.c
  2. +2 −3 CFLocale.c
View
@@ -1190,7 +1190,7 @@ __private_extern__ CFArrayRef _CFBundleCopyUserLanguages(Boolean useBackstops) {
CFArrayRef result = NULL;
static CFArrayRef userLanguages = NULL;
static Boolean didit = false;
- CFArrayRef preferencesArray = NULL;
+ CFArrayRef preferencesArray = CFLocaleCopyPreferredLanguages();
// This is a temporary solution, until the argument domain is moved down into CFPreferences
__CFSpinLock(&CFBundleResourceGlobalDataLock);
if (!didit) {
View
@@ -620,12 +620,11 @@ CFArrayRef CFLocaleCopyPreferredLanguages(void) {
CFMutableArrayRef newArray = CFArrayCreateMutable(kCFAllocatorSystemDefault, 0, &kCFTypeArrayCallBacks);
#if DEPLOYMENT_TARGET_WINDOWS
- LANGID langId = GetUserDefaultUILanguage();
+ LANGID langId = GetUserDefaultLangID();
CFStringRef lang_name = __CFLocaleWindowsLCIDToISOLocaleName(langId);
CFArrayAppendValue(newArray, lang_name);
#else
- CFArrayRef languagesArray = NULL;
- languagesArray = (CFArrayRef)CFPreferencesCopyAppValue(CFSTR("AppleLanguages"), kCFPreferencesCurrentApplication);
+ CFArrayRef languagesArray = (CFArrayRef)CFPreferencesCopyAppValue(CFSTR("AppleLanguages"), kCFPreferencesCurrentApplication);
if (languagesArray && (CFArrayGetTypeID() == CFGetTypeID(languagesArray))) {
for (CFIndex idx = 0, cnt = CFArrayGetCount(languagesArray); idx < cnt; idx++) {
CFStringRef str = (CFStringRef)CFArrayGetValueAtIndex(languagesArray, idx);

0 comments on commit f2f9908

Please sign in to comment.