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

Unified Diff: base/strings/string_number_conversions.h

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 | « ash/system/chromeos/network/tray_sms.cc ('k') | chrome/app/bookmarks_strings.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string_number_conversions.h
diff --git a/base/strings/string_number_conversions.h b/base/strings/string_number_conversions.h
index 1265f0dcba3a443a16fe06e79c838e450745058c..a3b876aa155c40d3ba00bb62d5aab988723e8e31 100644
--- a/base/strings/string_number_conversions.h
+++ b/base/strings/string_number_conversions.h
@@ -25,6 +25,14 @@
// Please do not add "convenience" functions for converting strings to integers
// that return the value and ignore success/failure. That encourages people to
// write code that doesn't properly handle the error conditions.
+//
+// DO NOT use these functions in any UI unless it's NOT localized on purpose.
+// Instead, use base::MessageFormatter for a complex message with numbers
+// (integer, float, double) embedded or base::Format{Number,Double,Percent} to
+// just format a single number/percent. Note that some languages use native
+// digits instead of ASCII digits while others use a group separator or decimal
+// point different from ',' and '.'. Using these functions in the UI would lead
+// numbers to be formatted in a non-native way.
// ----------------------------------------------------------------------------
namespace base {
« no previous file with comments | « ash/system/chromeos/network/tray_sms.cc ('k') | chrome/app/bookmarks_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698