Commit 9e93379e authored by Rachel Carpenter's avatar Rachel Carpenter Committed by Commit Bot

Add application locale and use that instead of language.

The language that is currently used in loadtimedata has had the region
code stripped out. This means that we can't tell the difference between
en-GB and en-US, or zh-CN and zh-TW. That means they fall back to
english for our app.

Using application locale solves this.

Bug: b/157427039
Change-Id: Id83d420752aa9da0808652693194ecf6bc9b5702
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2215158Reviewed-by: default avatardstockwell <dstockwell@chromium.org>
Commit-Queue: Rachel Carpenter <carpenterr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772523}
parent 04461e81
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "ash/public/cpp/assistant/assistant_state.h" #include "ash/public/cpp/assistant/assistant_state.h"
#include "ash/public/cpp/tablet_mode.h" #include "ash/public/cpp/tablet_mode.h"
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/chromeos/assistant/assistant_util.h" #include "chrome/browser/chromeos/assistant/assistant_util.h"
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
...@@ -46,6 +47,7 @@ base::Optional<std::string> ChromeHelpAppUIDelegate::OpenFeedbackDialog() { ...@@ -46,6 +47,7 @@ base::Optional<std::string> ChromeHelpAppUIDelegate::OpenFeedbackDialog() {
void ChromeHelpAppUIDelegate::PopulateLoadTimeData( void ChromeHelpAppUIDelegate::PopulateLoadTimeData(
content::WebUIDataSource* source) { content::WebUIDataSource* source) {
source->AddLocalizedString("getHelpName", IDS_GENIUS_APP_NAME); source->AddLocalizedString("getHelpName", IDS_GENIUS_APP_NAME);
source->AddString("appLocale", g_browser_process->GetApplicationLocale());
// Add strings that can be pulled in. // Add strings that can be pulled in.
source->AddString("boardName", base::SysInfo::GetLsbReleaseBoard()); source->AddString("boardName", base::SysInfo::GetLsbReleaseBoard());
source->AddString("chromeOSVersion", base::SysInfo::OperatingSystemVersion()); source->AddString("chromeOSVersion", base::SysInfo::OperatingSystemVersion());
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<!DOCTYPE html> <!DOCTYPE html>
<html dir="$i18n{textdirection}" lang="$i18n{language}"> <html dir="$i18n{textdirection}" lang="$i18n{appLocale}">
<meta charset="utf-8"> <meta charset="utf-8">
<style> <style>
body { body {
......
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
// Test that language is set correctly on the guest frame. // Test that language is set correctly on the guest frame.
GUEST_TEST('GuestHasLang', () => { GUEST_TEST('GuestHasLang', () => {
assertEquals(document.documentElement.lang, 'en'); assertEquals(document.documentElement.lang, 'en-US');
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment