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

Unified Diff: chrome/browser/profiles/profile_attributes_storage.cc

Issue 2002783002: Use plural formats and native digits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: plural: use "=1" instead of "one" for pop-up block infobar Created 4 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 | « chrome/browser/media/native_desktop_media_list.cc ('k') | chrome/browser/resources/history/history.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_attributes_storage.cc
diff --git a/chrome/browser/profiles/profile_attributes_storage.cc b/chrome/browser/profiles/profile_attributes_storage.cc
index f5a718060ebfaa6b37bceb697b8da9c7921cdcbb..bdd6d47cdcaffdf3f5e5d510e3793b106ad60e15 100644
--- a/chrome/browser/profiles/profile_attributes_storage.cc
+++ b/chrome/browser/profiles/profile_attributes_storage.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/i18n/number_formatting.h"
#include "base/i18n/string_compare.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
@@ -120,17 +121,22 @@ base::string16 ProfileAttributesStorage::ChooseNameForNewProfile(
base::string16 name;
for (int name_index = 1; ; ++name_index) {
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
- name = l10n_util::GetStringFUTF16Int(IDS_NEW_NUMBERED_PROFILE_NAME,
- name_index);
+ // Using native digits will break IsDefaultProfileName() below because
+ // it uses sscanf.
+ // TODO(jshin): fix IsDefaultProfileName to handle native digits.
+ name = l10n_util::GetStringFUTF16(IDS_NEW_NUMBERED_PROFILE_NAME,
+ base::IntToString16(name_index));
#else
if (icon_index < profiles::GetGenericAvatarIconCount()) {
name = l10n_util::GetStringFUTF16Int(IDS_NUMBERED_PROFILE_NAME,
name_index);
} else {
+ // TODO(jshin): Check with UX if appending |name_index| to the default
+ // name without a space is intended.
name = l10n_util::GetStringUTF16(
kDefaultNames[icon_index - profiles::GetGenericAvatarIconCount()]);
if (name_index > 1)
- name.append(base::UTF8ToUTF16(base::IntToString(name_index)));
+ name.append(base::FormatNumber(name_index));
}
#endif
« no previous file with comments | « chrome/browser/media/native_desktop_media_list.cc ('k') | chrome/browser/resources/history/history.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698