From: Cheng Zhao Date: Thu, 29 May 2014 07:21:15 +0000 (+0800) Subject: Override application locale with system default locale. X-Git-Tag: v0.13.0~9^2~6 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=649730244b6b17a86f0132c68fd51400192d28b6;p=electron.git Override application locale with system default locale. --- diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index c70b6812..74b38d6b 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -13,6 +13,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" +#include "ui/base/l10n/l10n_util.h" #include "webkit/common/webpreferences.h" namespace atom { @@ -88,6 +89,10 @@ bool AtomBrowserClient::ShouldSwapProcessesForNavigation( return true; } +std::string AtomBrowserClient::GetApplicationLocale() { + return l10n_util::GetApplicationLocale(""); +} + void AtomBrowserClient::AppendExtraCommandLineSwitches( CommandLine* command_line, int child_process_id) { diff --git a/atom/browser/atom_browser_client.h b/atom/browser/atom_browser_client.h index 89360fa9..8111af47 100644 --- a/atom/browser/atom_browser_client.h +++ b/atom/browser/atom_browser_client.h @@ -25,6 +25,7 @@ class AtomBrowserClient : public brightray::BrowserClient { content::SiteInstance* site_instance, const GURL& current_url, const GURL& new_url) OVERRIDE; + virtual std::string GetApplicationLocale() OVERRIDE; virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, int child_process_id) OVERRIDE;