Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Don't update settings.locale with our detected locale from OS. #126

Merged
merged 1 commit into from
Oct 10, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion appshell/cefclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ void AppGetSettings(CefSettings& settings, CefRefPtr<ClientApp> app) {
}
}

CefString(&settings.locale) = app->GetCurrentLanguage();
// Don't update the settings.locale with the locale that we detected from the OS.
// Otherwise, CEF will use it to find the resources and when it fails in finding resources
// for some locales that are not available in resources, it crashes.
//CefString(&settings.locale) = app->GetCurrentLanguage( );

CefString(&settings.javascript_flags) =
g_command_line->GetSwitchValue(cefclient::kJavascriptFlags);
Expand Down
11 changes: 0 additions & 11 deletions appshell/client_app_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@

NSString* language = [[NSLocale preferredLanguages] objectAtIndex:0];

// Remap zh-Hans --> zh-CN and zh-Hant --> zh-TW so that CEF3 can find the corresponding localized resources.
// We may need to remove these two lines in the future if CEF3 switches to the newer locale names.
language = [language stringByReplacingOccurrencesOfString:@"Hans" withString:@"CN"];
language = [language stringByReplacingOccurrencesOfString:@"Hant" withString:@"TW"];

// Remap pt --> pt-BR so that we can load the CEF3 resource for Brazilian Portuguese.
// [rlim] I believe this is the last one that we have to remap. If we find any to reamp again,
// then we should just switch to CFLocaleCopyPreferredLanguages() instead of [[NSLocale preferredLanguages].
if ([language isEqualToString:@"pt"])
language = [language stringByReplacingOccurrencesOfString:@"pt" withString:@"pt-BR"];

CefString result = [language UTF8String];
return result;
}
Expand Down