From 4b917eb1d25ac97513749d5120bb4d405da60a1c Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Thu, 9 Apr 2009 21:59:04 +0000 Subject: Change the download UI not to report xx bytes of 0 bytes. Just report "xx bytes" instead, so this does not require additional translations. BUG=9782 Review URL: http://codereview.chromium.org/67005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13467 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/dom_ui/downloads_ui.cc | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/dom_ui/downloads_ui.cc b/chrome/browser/dom_ui/downloads_ui.cc index ddd3ee2..cd3ac91 100644 --- a/chrome/browser/dom_ui/downloads_ui.cc +++ b/chrome/browser/dom_ui/downloads_ui.cc @@ -475,17 +475,20 @@ std::wstring DownloadsDOMHandler::GetProgressStatusText( received_size.assign(amount_localized); } - amount_units = GetByteDisplayUnits(total); - std::wstring total_text = FormatBytes(total, amount_units, true); - std::wstring total_text_localized; - if (l10n_util::AdjustStringForLocaleDirection(total_text, - &total_text_localized)) - total_text.assign(total_text_localized); - - amount = l10n_util::GetStringF(IDS_DOWNLOAD_TAB_PROGRESS_SIZE, - received_size, - total_text); - + if (total) { + amount_units = GetByteDisplayUnits(total); + std::wstring total_text = FormatBytes(total, amount_units, true); + std::wstring total_text_localized; + if (l10n_util::AdjustStringForLocaleDirection(total_text, + &total_text_localized)) + total_text.assign(total_text_localized); + + amount = l10n_util::GetStringF(IDS_DOWNLOAD_TAB_PROGRESS_SIZE, + received_size, + total_text); + } else { + amount.assign(received_size); + } amount_units = GetByteDisplayUnits(download->CurrentSpeed()); std::wstring speed_text = FormatSpeed(download->CurrentSpeed(), amount_units, true); -- cgit v1.1