diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index d702a8e5a1..57c6e3f829 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -50,6 +50,7 @@ #include "base/values.h" #include "brightray/browser/inspectable_web_contents.h" #include "brightray/browser/inspectable_web_contents_view.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_preview_message_handler.h" #include "chrome/browser/printing/print_view_manager_basic.h" #include "chrome/browser/ssl/security_state_tab_helper.h" @@ -102,7 +103,6 @@ struct PrintSettings { bool print_background; base::string16 device_name; }; - } // namespace namespace mate { @@ -437,9 +437,11 @@ void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate, managed_web_contents()->GetView()->SetDelegate(this); + auto* prefs = web_contents->GetMutableRendererPrefs(); + prefs->accept_languages = g_browser_process->GetApplicationLocale(); + #if defined(OS_LINUX) || defined(OS_WIN) // Update font settings. - auto* prefs = web_contents->GetMutableRendererPrefs(); CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params, (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr))); prefs->should_antialias_text = params.antialiasing; diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index b124509934..05b833fae9 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -132,6 +132,14 @@ describe('chromium feature', () => { }) }) + describe('navigator.languages', (done) => { + it('should return the system locale only', () => { + let appLocale = app.getLocale() + assert.equal(navigator.languages.length, 1) + assert.equal(navigator.languages[0], appLocale) + }) + }) + describe('navigator.serviceWorker', () => { it('should register for file scheme', (done) => { w = new BrowserWindow({