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

Unified Diff: ui/base/l10n/time_format.cc

Issue 1049513002: Use the ICU syntax message for plural formatting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ios whitelist update Created 5 years, 8 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 | « ui/base/l10n/l10n_util_plurals.cc ('k') | ui/base/l10n/time_format_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/l10n/time_format.cc
diff --git a/ui/base/l10n/time_format.cc b/ui/base/l10n/time_format.cc
index 5154c6dd9d30fec53c3d65eb5d8c576edded6c72..0c77d3407ec10bb48ec3fd20184de7c0d63e9b67 100644
--- a/ui/base/l10n/time_format.cc
+++ b/ui/base/l10n/time_format.cc
@@ -61,7 +61,7 @@ base::string16 TimeFormat::Detailed(TimeFormat::Format format,
if (delta < one_minute - half_second) {
// Anything up to 59.500 seconds is formatted as seconds.
const int seconds = static_cast<int>((delta + half_second).InSeconds());
- formatter->Format(Formatter::UNIT_SEC, seconds, time_string);
+ formatter->Format(Formatter::UNIT_SEC, seconds, &time_string);
} else if (delta < one_hour - (cutoff < 60 ? half_minute : half_second)) {
// Anything up to 59.5 minutes (respectively 59:59.500 when |cutoff| permits
@@ -69,13 +69,13 @@ base::string16 TimeFormat::Detailed(TimeFormat::Format format,
// seconds).
if (delta >= cutoff * one_minute - half_second) {
const int minutes = (delta + half_minute).InMinutes();
- formatter->Format(Formatter::UNIT_MIN, minutes, time_string);
+ formatter->Format(Formatter::UNIT_MIN, minutes, &time_string);
} else {
const int minutes = (delta + half_second).InMinutes();
const int seconds = static_cast<int>(
(delta + half_second).InSeconds() % 60);
formatter->Format(Formatter::TWO_UNITS_MIN_SEC,
- minutes, seconds, time_string);
+ minutes, seconds, &time_string);
}
} else if (delta < one_day - (cutoff < 24 ? half_hour : half_minute)) {
@@ -84,24 +84,24 @@ base::string16 TimeFormat::Detailed(TimeFormat::Format format,
// minutes).
if (delta >= cutoff * one_hour - half_minute) {
const int hours = (delta + half_hour).InHours();
- formatter->Format(Formatter::UNIT_HOUR, hours, time_string);
+ formatter->Format(Formatter::UNIT_HOUR, hours, &time_string);
} else {
const int hours = (delta + half_minute).InHours();
const int minutes = (delta + half_minute).InMinutes() % 60;
formatter->Format(Formatter::TWO_UNITS_HOUR_MIN,
- hours, minutes, time_string);
+ hours, minutes, &time_string);
}
} else {
// Anything bigger is formatted as days (respectively days and hours).
if (delta >= cutoff * one_day - half_hour) {
const int days = (delta + half_day).InDays();
- formatter->Format(Formatter::UNIT_DAY, days, time_string);
+ formatter->Format(Formatter::UNIT_DAY, days, &time_string);
} else {
const int days = (delta + half_hour).InDays();
const int hours = (delta + half_hour).InHours() % 24;
formatter->Format(Formatter::TWO_UNITS_DAY_HOUR,
- days, hours, time_string);
+ days, hours, &time_string);
}
}
« no previous file with comments | « ui/base/l10n/l10n_util_plurals.cc ('k') | ui/base/l10n/time_format_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698