summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 22:05:51 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 22:05:51 +0000
commit463e1b438bc32ccf0ae34251b1046c15b8018071 (patch)
treeabb1cfba6df1db5948dbe8ba524831881b97d48a /chrome/browser/download
parent382323aa919954ddf0495f032cf15bb7ff3a3285 (diff)
downloadchromium_src-463e1b438bc32ccf0ae34251b1046c15b8018071.zip
chromium_src-463e1b438bc32ccf0ae34251b1046c15b8018071.tar.gz
chromium_src-463e1b438bc32ccf0ae34251b1046c15b8018071.tar.bz2
Internationalize the prefix of unconfirmed download file.
BUG=3563 TEST=manual Review URL: http://codereview.chromium.org/6247015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_file_manager.cc2
-rw-r--r--chrome/browser/download/download_manager.cc11
-rw-r--r--chrome/browser/download/download_manager_unittest.cc4
3 files changed, 13 insertions, 4 deletions
diff --git a/chrome/browser/download/download_file_manager.cc b/chrome/browser/download/download_file_manager.cc
index 05b8147..dc8fdbd 100644
--- a/chrome/browser/download/download_file_manager.cc
+++ b/chrome/browser/download/download_file_manager.cc
@@ -317,7 +317,7 @@ void DownloadFileManager::OnIntermediateDownloadName(
// There are 3 possible rename cases where this method can be called:
// 1. tmp -> foo (need_delete_crdownload=T)
// 2. foo.crdownload -> foo (need_delete_crdownload=F)
-// 3. tmp-> unconfirmed.xxx.crdownload (need_delete_crdownload=F)
+// 3. tmp-> Unconfirmed.xxx.crdownload (need_delete_crdownload=F)
void DownloadFileManager::OnFinalDownloadName(
int id, const FilePath& full_path, bool need_delete_crdownload,
DownloadManager* download_manager) {
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 9e47b35..24acf1d 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -333,10 +333,19 @@ void DownloadManager::CheckIfSuggestedPathExists(DownloadCreateInfo* info,
// download.
FilePath::StringType file_name;
FilePath path;
+#if defined(OS_WIN)
+ string16 unconfirmed_prefix =
+ l10n_util::GetStringUTF16(IDS_DOWNLOAD_UNCONFIRMED_PREFIX);
+#else
+ std::string unconfirmed_prefix =
+ l10n_util::GetStringUTF8(IDS_DOWNLOAD_UNCONFIRMED_PREFIX);
+#endif
+
while (path.empty()) {
base::SStringPrintf(
&file_name,
- FILE_PATH_LITERAL("unconfirmed %d.crdownload"),
+ unconfirmed_prefix.append(
+ FILE_PATH_LITERAL(" %d.crdownload")).c_str(),
base::RandInt(0, 100000));
path = dir.Append(file_name);
if (file_util::PathExists(path))
diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc
index 2db13be..610fb98 100644
--- a/chrome/browser/download/download_manager_unittest.cc
+++ b/chrome/browser/download/download_manager_unittest.cc
@@ -166,7 +166,7 @@ const struct {
1, },
// Dangerous download, download finishes BEFORE rename.
// Needs to be renamed only once.
- { FILE_PATH_LITERAL("unconfirmed xxx.crdownload"),
+ { FILE_PATH_LITERAL("Unconfirmed xxx.crdownload"),
true,
true,
false,
@@ -180,7 +180,7 @@ const struct {
2, },
// Dangerous download, download finishes AFTER rename.
// Needs to be renamed only once.
- { FILE_PATH_LITERAL("unconfirmed xxx.crdownload"),
+ { FILE_PATH_LITERAL("Unconfirmed xxx.crdownload"),
true,
false,
false,