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

Side by Side Diff: chrome/browser/ui/views/payments/payment_sheet_view_controller.cc

Issue 2827293003: [Web Payments] Correct pluralization of "more items" (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/payments_strings.grdp » ('j') | components/payments_strings.grdp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" 5 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 new views::Label(base::ASCIIToUTF16(items[i]->label))); 432 new views::Label(base::ASCIIToUTF16(items[i]->label)));
433 433
434 item_amounts_layout->StartRow(0, 0); 434 item_amounts_layout->StartRow(0, 0);
435 item_amounts_layout->AddView(new views::Label( 435 item_amounts_layout->AddView(new views::Label(
436 spec()->GetFormattedCurrencyAmount(items[i]->amount->value))); 436 spec()->GetFormattedCurrencyAmount(items[i]->amount->value)));
437 } 437 }
438 438
439 int hidden_item_count = items.size() - kMaxNumberOfItemsShown; 439 int hidden_item_count = items.size() - kMaxNumberOfItemsShown;
440 if (hidden_item_count > 0) { 440 if (hidden_item_count > 0) {
441 item_summaries_layout->StartRow(0, 0); 441 item_summaries_layout->StartRow(0, 0);
442 std::unique_ptr<views::Label> label = base::MakeUnique<views::Label>( 442 base::string16 more_items_label =
please use gerrit instead 2017/04/20 15:05:27 Please see for an example of how this should be do
anthonyvd 2017/04/20 15:34:10 Ah, awesome! Done.
443 l10n_util::GetStringFUTF16(IDS_PAYMENT_REQUEST_ORDER_SUMMARY_MORE_ITEMS, 443 hidden_item_count == 1
444 base::IntToString16(hidden_item_count))); 444 ? l10n_util::GetStringUTF16(
445 IDS_PAYMENT_REQUEST_ORDER_SUMMARY_ONE_MORE_ITEM)
446 : l10n_util::GetStringFUTF16(
447 IDS_PAYMENT_REQUEST_ORDER_SUMMARY_MORE_ITEMS,
448 base::IntToString16(hidden_item_count));
449 std::unique_ptr<views::Label> label =
450 base::MakeUnique<views::Label>(more_items_label);
445 label->SetDisabledColor(label->GetNativeTheme()->GetSystemColor( 451 label->SetDisabledColor(label->GetNativeTheme()->GetSystemColor(
446 ui::NativeTheme::kColorId_LabelDisabledColor)); 452 ui::NativeTheme::kColorId_LabelDisabledColor));
447 label->SetEnabled(false); 453 label->SetEnabled(false);
448 item_summaries_layout->AddView(label.release()); 454 item_summaries_layout->AddView(label.release());
449 455
450 item_amounts_layout->StartRow(0, 0); 456 item_amounts_layout->StartRow(0, 0);
451 item_amounts_layout->AddView(new views::Label(base::ASCIIToUTF16(""))); 457 item_amounts_layout->AddView(new views::Label(base::ASCIIToUTF16("")));
452 } 458 }
453 459
454 item_summaries_layout->StartRow(0, 0); 460 item_summaries_layout->StartRow(0, 0);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 PaymentSheetViewControllerTags::SHOW_SHIPPING_OPTION_BUTTON), 686 PaymentSheetViewControllerTags::SHOW_SHIPPING_OPTION_BUTTON),
681 static_cast<int>( 687 static_cast<int>(
682 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION_BUTTON), 688 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION_BUTTON),
683 widest_name_column_view_width_); 689 widest_name_column_view_width_);
684 } 690 }
685 691
686 return section; 692 return section;
687 } 693 }
688 694
689 } // namespace payments 695 } // namespace payments
OLDNEW
« no previous file with comments | « no previous file | components/payments_strings.grdp » ('j') | components/payments_strings.grdp » ('J')

Powered by Google App Engine
This is Rietveld 408576698