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

Unified Diff: chrome/browser/ui/views/critical_notification_bubble_view.cc

Issue 2002673003: i18n of several browser messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move IDS_CRITICAL_NOTIFICATION_ strings to chrome/chromium files 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
Index: chrome/browser/ui/views/critical_notification_bubble_view.cc
diff --git a/chrome/browser/ui/views/critical_notification_bubble_view.cc b/chrome/browser/ui/views/critical_notification_bubble_view.cc
index ded52e7bc5d936e5251b4921819a180f8901aa7b..d8d1913f0b5779bcb1e5e914e4e39ea82b329606 100644
--- a/chrome/browser/ui/views/critical_notification_bubble_view.cc
+++ b/chrome/browser/ui/views/critical_notification_bubble_view.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/ui/views/critical_notification_bubble_view.h"
-#include "base/strings/string_number_conversions.h"
+#include "base/i18n/message_formatter.h"
Greg Levin 2016/05/27 16:58:03 TODO: Remove in next patch
Greg Levin 2016/05/27 19:31:47 Done.
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime.h"
@@ -83,13 +83,10 @@ void CriticalNotificationBubbleView::OnCountdown() {
base::string16 CriticalNotificationBubbleView::GetWindowTitle() const {
int seconds = GetRemainingTime();
- return seconds > 0 ? l10n_util::GetStringFUTF16(
- IDS_CRITICAL_NOTIFICATION_HEADLINE,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
- base::IntToString16(seconds))
- : l10n_util::GetStringFUTF16(
- IDS_CRITICAL_NOTIFICATION_HEADLINE_ALTERNATE,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
+ return seconds > 0 ? l10n_util::GetPluralStringFUTF16(
+ IDS_CRITICAL_NOTIFICATION_HEADLINE, seconds)
+ : l10n_util::GetStringUTF16(
+ IDS_CRITICAL_NOTIFICATION_HEADLINE_ALTERNATE);
jungshik at Google 2016/05/27 17:53:12 You can use l10n_util::GetStringUTF16(IDS_PRODUCT_
Peter Kasting 2016/05/27 18:48:29 I thought the l10n folks asked us to phase out sub
Greg Levin 2016/05/27 19:31:47 Acknowledged.
}
gfx::ImageSkia CriticalNotificationBubbleView::GetWindowIcon() {
@@ -139,8 +136,7 @@ void CriticalNotificationBubbleView::Init() {
views::Label* message = new views::Label();
message->SetMultiLine(true);
message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- message->SetText(l10n_util::GetStringFUTF16(IDS_CRITICAL_NOTIFICATION_TEXT,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
+ message->SetText(l10n_util::GetStringUTF16(IDS_CRITICAL_NOTIFICATION_TEXT));
jungshik at Google 2016/05/27 17:53:12 Any reason NOT to use a common message along with
Peter Kasting 2016/05/27 18:48:29 Same comment.
Greg Levin 2016/05/27 19:31:47 Acknowledged.
message->SizeToFit(views::Widget::GetLocalizedContentsWidth(
IDS_CRUCIAL_NOTIFICATION_BUBBLE_WIDTH_CHARS));
AddChildView(message);

Powered by Google App Engine
This is Rietveld 408576698