Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6757)

Unified Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 1137373003: [Mac] Localize app shims with the OS preferred language. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_mac.mm
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index aaa84468fc4000a01a92bcbb37aec064e106ef7b..abb9cfa5d9aca32e30075eb000fc6970a2ed5b24 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -897,9 +897,13 @@ bool WebAppShortcutCreator::UpdatePlist(const base::FilePath& app_path) const {
bool WebAppShortcutCreator::UpdateDisplayName(
const base::FilePath& app_path) const {
- // OSX searches for the best language in the order of preferred languages.
- // Since we only have one localization directory, it will choose this one.
- base::FilePath localized_dir = GetResourcesPath(app_path).Append("en.lproj");
+ // Localization is used to display the app name (rather than the bundle
+ // filename). OSX searches for the best language in the order of preferred
+ // languages, but one of them must be found otherwise it will default to
+ // the filename.
+ NSString* language = [[NSLocale preferredLanguages] objectAtIndex:0];
tapted 2015/05/14 07:53:14 should it use l10n_util::NormalizeLocale(l10n_util
jackhou1 2015/05/15 00:41:08 With the app shim, we don't actually care what lan
+ base::FilePath localized_dir = GetResourcesPath(app_path).Append(
+ base::SysNSStringToUTF8(language) + ".lproj");
if (!base::CreateDirectory(localized_dir))
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698