mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-24 09:50:54 -06:00
Bug 794807 - Calendar widget current month shown as (null).
Locales need to end in UTF-8 to work right.
This commit is contained in:
parent
b0a5673079
commit
4006e5a488
@ -135,7 +135,7 @@ mac_find_close_country(NSString *locale_str, NSString *country_str,
|
||||
NSString *this_locale, *new_locale = nil;
|
||||
PWARN("Apple Locale is set to a value %s not supported"
|
||||
" by the C runtime", [locale_str UTF8String]);
|
||||
while ((this_locale = (NSString*)[locale_iter nextObject]))
|
||||
while ((this_locale = [(NSString*)[locale_iter nextObject] stringByAppendingString: @".UTF-8"]))
|
||||
if ([ [ [NSLocale componentsFromLocaleIdentifier: this_locale]
|
||||
objectForKey: NSLocaleCountryCode]
|
||||
isEqualToString: country_str] &&
|
||||
@ -158,7 +158,7 @@ mac_find_close_country(NSString *locale_str, NSString *country_str,
|
||||
locale_str = new_locale;
|
||||
else
|
||||
{
|
||||
locale_str = @"en_US";
|
||||
locale_str = @"en_US.UTF-8";
|
||||
setlocale(LC_ALL, [locale_str UTF8String]);
|
||||
}
|
||||
PWARN("Using %s instead.", [locale_str UTF8String]);
|
||||
@ -233,8 +233,9 @@ set_mac_locale()
|
||||
{
|
||||
lang_str = [locale objectForKey: NSLocaleLanguageCode];
|
||||
country_str = [locale objectForKey: NSLocaleCountryCode];
|
||||
locale_str = [ [lang_str stringByAppendingString: @"_"]
|
||||
stringByAppendingString: country_str];
|
||||
locale_str = [[[lang_str stringByAppendingString: @"_"]
|
||||
stringByAppendingString: country_str]
|
||||
stringByAppendingString: @".UTF-8"];
|
||||
}
|
||||
@catch (NSException *err)
|
||||
{
|
||||
@ -246,7 +247,7 @@ set_mac_locale()
|
||||
}
|
||||
/* If we didn't get a valid current locale, the string will be just "_" */
|
||||
if ([locale_str isEqualToString: @"_"])
|
||||
locale_str = @"en_US";
|
||||
locale_str = @"en_US.UTF-8";
|
||||
|
||||
lang_str = mac_convert_complex_language(lang_str);
|
||||
if (!setlocale(LC_ALL, [locale_str UTF8String]))
|
||||
|
Loading…
Reference in New Issue
Block a user