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

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

Issue 2751833005: Add Distillation info to Reading List view. (Closed)
Patch Set: clean Created 3 years, 9 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
Index: ui/base/l10n/formatter.cc
diff --git a/ui/base/l10n/formatter.cc b/ui/base/l10n/formatter.cc
index e15be773ceb6221387c8183e90c880590e8c700a..2764907cc4712a28f4d1da916210ba96ddb9ae0e 100644
--- a/ui/base/l10n/formatter.cc
+++ b/ui/base/l10n/formatter.cc
@@ -30,11 +30,19 @@ static const Pluralities IDS_ELAPSED_SHORT_SEC = {
"one{# sec ago}",
" other{# secs ago}"
};
+
+static const Pluralities IDS_ELAPSED_LONG_SEC = {
gambard 2017/03/16 07:50:24 Are those files supposed to be in this CL?
Olivier 2017/03/16 09:20:15 As said in message, this part is in another CL (ht
+ IDS_TIME_ELAPSED_LONG_SECS, "one{# second ago}", " other{# seconds ago}"};
+
static const Pluralities IDS_ELAPSED_SHORT_MIN = {
IDS_TIME_ELAPSED_MINS,
"one{# min ago}",
" other{# mins ago}"
};
+
+static const Pluralities IDS_ELAPSED_LONG_MIN = {
+ IDS_TIME_ELAPSED_LONG_MINS, "one{# minute ago}", " other{# minutes ago}"};
+
static const Pluralities IDS_ELAPSED_HOUR = {
IDS_TIME_ELAPSED_HOURS,
"one{# hour ago}",
@@ -265,8 +273,6 @@ std::unique_ptr<icu::MessageFormat> Formatter::InitFormat(
const Formatter* FormatterContainer::Get(TimeFormat::Format format,
TimeFormat::Length length) const {
- DCHECK(formatter_[format][length])
- << "Combination of FORMAT_ELAPSED and LENGTH_LONG is not implemented!";
return formatter_[format][length].get();
}
@@ -283,7 +289,9 @@ void FormatterContainer::Initialize() {
IDS_ELAPSED_SHORT_MIN,
IDS_ELAPSED_HOUR,
IDS_ELAPSED_DAY));
- formatter_[TimeFormat::FORMAT_ELAPSED][TimeFormat::LENGTH_LONG].reset();
+ formatter_[TimeFormat::FORMAT_ELAPSED][TimeFormat::LENGTH_LONG].reset(
+ new Formatter(IDS_ELAPSED_LONG_SEC, IDS_ELAPSED_LONG_MIN,
+ IDS_ELAPSED_HOUR, IDS_ELAPSED_DAY));
formatter_[TimeFormat::FORMAT_REMAINING][TimeFormat::LENGTH_SHORT].reset(
new Formatter(IDS_REMAINING_SHORT_SEC,
IDS_REMAINING_SHORT_MIN,

Powered by Google App Engine
This is Rietveld 408576698