Index: chrome/browser/browser_main.cc |
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc |
index 5da1a3141be05b343422e7cebbca45287b5e97b0..d47d3ca72f2b256281ee42a88a168c1f6cf2880f 100644 |
--- a/chrome/browser/browser_main.cc |
+++ b/chrome/browser/browser_main.cc |
@@ -831,6 +831,14 @@ bool IsCrashReportingEnabled(const PrefService* local_state) { |
} // namespace |
+namespace chrome_browser { |
+// This error message is not localized because we failed to load the |
+// localization data files. |
+const char kMissingLocaleDataTitle[] = "Missing File Error"; |
+const char kMissingLocaleDataMessage[] = |
+ "Unable to find locale data files. Please reinstall."; |
+} // namespace chrome_browser |
+ |
// BrowserMainParts ------------------------------------------------------------ |
BrowserMainParts::BrowserMainParts(const MainFunctionParams& parameters) |
@@ -1440,6 +1448,11 @@ int BrowserMain(const MainFunctionParams& parameters) { |
// method InitSharedInstance is ignored. |
const std::string loaded_locale = |
ResourceBundle::InitSharedInstance(locale); |
+ if (loaded_locale.empty() && |
+ !parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) { |
+ ShowMissingLocaleMessageBox(); |
+ return chrome::RESULT_CODE_MISSING_DATA; |
+ } |
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; |
g_browser_process->SetApplicationLocale(loaded_locale); |