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

Commit 5fdbee0

Browse files
committed
Merge pull request #126 from adobe/rlim/mac-locale-issue
Don't update settings.locale with our detected locale from OS.
2 parents b52af87 + ca9ee2f commit 5fdbee0

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

appshell/cefclient.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ void AppGetSettings(CefSettings& settings, CefRefPtr<ClientApp> app) {
101101
}
102102
}
103103

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

106109
CefString(&settings.javascript_flags) =
107110
g_command_line->GetSwitchValue(cefclient::kJavascriptFlags);

appshell/client_app_mac.mm

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@
5050

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

53-
// Remap zh-Hans --> zh-CN and zh-Hant --> zh-TW so that CEF3 can find the corresponding localized resources.
54-
// We may need to remove these two lines in the future if CEF3 switches to the newer locale names.
55-
language = [language stringByReplacingOccurrencesOfString:@"Hans" withString:@"CN"];
56-
language = [language stringByReplacingOccurrencesOfString:@"Hant" withString:@"TW"];
57-
58-
// Remap pt --> pt-BR so that we can load the CEF3 resource for Brazilian Portuguese.
59-
// [rlim] I believe this is the last one that we have to remap. If we find any to reamp again,
60-
// then we should just switch to CFLocaleCopyPreferredLanguages() instead of [[NSLocale preferredLanguages].
61-
if ([language isEqualToString:@"pt"])
62-
language = [language stringByReplacingOccurrencesOfString:@"pt" withString:@"pt-BR"];
63-
6453
CefString result = [language UTF8String];
6554
return result;
6655
}

0 commit comments

Comments
 (0)