Commit 463e1b43 authored by tfarina@chromium.org's avatar tfarina@chromium.org

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
parent 382323aa
......@@ -2069,6 +2069,9 @@ each locale. -->
<message name="IDS_DOWNLOAD_STATUS_CANCELED" desc="Canceled text.">
Canceled
</message>
<message name="IDS_DOWNLOAD_UNCONFIRMED_PREFIX" desc="The prefix used in the unconfirmed download file.">
Unconfirmed
</message>
<message name="IDS_PROMPT_DANGEROUS_DOWNLOAD"
desc="Message shown to the user to validate the download of a dangerous file.">
......
......@@ -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) {
......
......@@ -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))
......
......@@ -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,
......
......@@ -35,7 +35,7 @@ void DownloadItemMac::OnDownloadUpdated(DownloadItem* download) {
}
if (download->GetUserVerifiedFilePath() != lastFilePath_) {
// Turns out the file path is "unconfirmed %d.crdownload" for dangerous
// Turns out the file path is "Unconfirmed %d.crdownload" for dangerous
// downloads. When the download is confirmed, the file is renamed on
// another thread, so reload the icon if the download filename changes.
LoadIcon();
......
......@@ -356,7 +356,7 @@ void DownloadItemGtk::OnDownloadUpdated(DownloadItem* download) {
}
if (download->GetUserVerifiedFilePath() != icon_filepath_) {
// Turns out the file path is "unconfirmed %d.crdownload" for dangerous
// Turns out the file path is "Unconfirmed %d.crdownload" for dangerous
// downloads. When the download is confirmed, the file is renamed on
// another thread, so reload the icon if the download filename changes.
LoadIcon();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment