diff options
author | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-09 16:47:10 +0000 |
---|---|---|
committer | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-09 16:47:10 +0000 |
commit | f95f075e0e41a6c6fa217bfdb9ef46b673ee3137 (patch) | |
tree | 5c1df1eab72cab0d79a5f73df842383929a6361e /chrome | |
parent | 564b491ea6d163724307331648bd7b45cdada99e (diff) | |
download | chromium_src-f95f075e0e41a6c6fa217bfdb9ef46b673ee3137.zip chromium_src-f95f075e0e41a6c6fa217bfdb9ef46b673ee3137.tar.gz chromium_src-f95f075e0e41a6c6fa217bfdb9ef46b673ee3137.tar.bz2 |
Fixing my localization laziness.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/683001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/generated_resources.grd | 50 | ||||
-rw-r--r-- | chrome/browser/browser_resources.grd | 2 | ||||
-rw-r--r-- | chrome/browser/dom_ui/filebrowse_ui.cc | 33 | ||||
-rw-r--r-- | chrome/browser/resources/filebrowse.html | 49 |
4 files changed, 108 insertions, 26 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index d5fb024..f0aa259 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6751,6 +6751,56 @@ Keep your key file in a safe place. You will need it to create new versions of y </message> </if> + <!-- Filebrowser Strings --> + <message name="IDS_FILEBROWSER_TITLE" desc="Title of the filebrowser"> + Content Browser + </message> + <message name="IDS_FILEBROWSER_PAUSE" desc="Action which allows the user to pause a current download"> + pause + </message> + <message name="IDS_FILEBROWSER_RESUME" desc="Action which allows the user to resume a paused download"> + resume + </message> + <message name="IDS_FILEBROWSER_SCANNING" desc="Notification to the user that we have detected a device and are now mounting it"> + Scanning Device... + </message> + <message name="IDS_FILEBROWSER_CONFIRM_DELETE" desc="Asks the user if they are sure they want to delete a file."> + Are you sure? + </message> + <message name="IDS_FILEBROWSER_CONFIRM_YES" desc="Confirm yes to a previous question."> + Yes + </message> + <message name="IDS_FILEBROWSER_CONFIRM_CANCEL" desc="Cancel a previous question."> + Cancel + </message> + <message name="IDS_FILEBROWSER_CONFIRM_DOWNLOAD" desc="Used to download a dangerous file."> + Allow Download? + </message> + <message name="IDS_FILEBROWSER_PROMPT_FILENAME" desc="Prompts the user for a filename."> + File name: + </message> + <message name="IDS_FILEBROWSER_SAVE" desc="Save button text"> + Save + </message> + <message name="IDS_FILEBROWSER_NEW_FOLDER" desc="New Folder Button"> + New Folder + </message> + <message name="IDS_FILEBROWSER_OPEN" desc="Open Button text"> + Open + </message> + <message name="IDS_FILEBROWSER_UPLOAD_PICASAWEB" desc="Upload to picasaweb menu item"> + Picasa Web + </message> + <message name="IDS_FILEBROWSER_UPLOAD_FLIKR" desc="Upload to Flikr menu item"> + Flikr + </message> + <message name="IDS_FILEBROWSER_UPLOAD_EMAIL" desc="Upload to email menu item"> + Email + </message> + <message name="IDS_FILEBROWSER_DELETE" desc="Delete file menu item"> + Delete + </message> + <!-- Chrome OS Strings --> <if expr="pp_ifdef('chromeos')"> <message name="IDS_INSTALLING_UPDATE" desc="Label shown on the updates installation screen"> diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 2a23433..9ce3355 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- This comment is only here because changes to resources are not picked up -without changes to the corresponding grd file. tat --> +without changes to the corresponding grd file. tea --> <grit latest_public_release="0" current_release="1"> <outputs> <output filename="grit/browser_resources.h" type="rc_header"> diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc index 74f23ed..a1b56d9 100644 --- a/chrome/browser/dom_ui/filebrowse_ui.cc +++ b/chrome/browser/dom_ui/filebrowse_ui.cc @@ -245,7 +245,38 @@ void FileBrowseUIHTMLSource::StartDataRequest(const std::string& path, DictionaryValue localized_strings; // TODO(dhg): Add stirings to localized strings, also add more strings // that are currently hardcoded. - localized_strings.SetString(L"devices", "devices"); + localized_strings.SetString(L"title", + l10n_util::GetString(IDS_FILEBROWSER_TITLE)); + localized_strings.SetString(L"pause", + l10n_util::GetString(IDS_FILEBROWSER_PAUSE)); + localized_strings.SetString(L"resume", + l10n_util::GetString(IDS_FILEBROWSER_RESUME)); + localized_strings.SetString(L"scanning", + l10n_util::GetString(IDS_FILEBROWSER_SCANNING)); + localized_strings.SetString(L"confirmdelete", + l10n_util::GetString(IDS_FILEBROWSER_CONFIRM_DELETE)); + localized_strings.SetString(L"confirmyes", + l10n_util::GetString(IDS_FILEBROWSER_CONFIRM_YES)); + localized_strings.SetString(L"confirmcancel", + l10n_util::GetString(IDS_FILEBROWSER_CONFIRM_CANCEL)); + localized_strings.SetString(L"allowdownload", + l10n_util::GetString(IDS_FILEBROWSER_CONFIRM_DOWNLOAD)); + localized_strings.SetString(L"filenameprompt", + l10n_util::GetString(IDS_FILEBROWSER_PROMPT_FILENAME)); + localized_strings.SetString(L"save", + l10n_util::GetString(IDS_FILEBROWSER_SAVE)); + localized_strings.SetString(L"newfolder", + l10n_util::GetString(IDS_FILEBROWSER_NEW_FOLDER)); + localized_strings.SetString(L"open", + l10n_util::GetString(IDS_FILEBROWSER_OPEN)); + localized_strings.SetString(L"picasaweb", + l10n_util::GetString(IDS_FILEBROWSER_UPLOAD_PICASAWEB)); + localized_strings.SetString(L"flikr", + l10n_util::GetString(IDS_FILEBROWSER_UPLOAD_FLIKR)); + localized_strings.SetString(L"email", + l10n_util::GetString(IDS_FILEBROWSER_UPLOAD_EMAIL)); + localized_strings.SetString(L"delete", + l10n_util::GetString(IDS_FILEBROWSER_DELETE)); SetFontAndTextDirection(&localized_strings); diff --git a/chrome/browser/resources/filebrowse.html b/chrome/browser/resources/filebrowse.html index ad9b75e..4ebbe325 100644 --- a/chrome/browser/resources/filebrowse.html +++ b/chrome/browser/resources/filebrowse.html @@ -2,7 +2,7 @@ <html i18n-values="dir:textdirection;"> <head> <meta charset="utf-8"> -<title>Content Browser</title> +<title i18n-content="title"></title> <style type="text/css"> div.header { border-bottom: 1px solid #7289E2; @@ -533,7 +533,7 @@ div.fullcontainer { } </style> -<script src='local_strings.js'></script> +<script src="local_strings.js"></script> <script> @@ -560,10 +560,11 @@ var selectFolder = false; var inSaveMode = false; var currentMenu = null; var mainColumn = null; +var localStrings; // strings -var kPauseDownload = 'pause'; -var kResumeDownload = 'resume'; +var kPauseDownload; +var kResumeDownload; function goBackInList() { if (currentNode > 0) { @@ -751,7 +752,7 @@ function setUpForScanning() { document.body.removeChild(header); var main = mainColumn; main.className = 'scanningcontainer'; - main.textContent = 'Scanning Device...'; + main.textContent = localStrings.getString('scanning'); }; @@ -857,14 +858,14 @@ function removeDeleteConfirm(path) { function deleteFileConfirm(path) { var askingDiv = document.createElement('div'); askingDiv.className = 'confirmdelete'; - askingDiv.textContent = 'Are you sure?'; + askingDiv.textContent = localStrings.getString('confirmdelete'); var yes = document.createElement('div'); yes.className = 'deleteYes'; - yes.textContent = 'Yes'; + yes.textContent = localStrings.getString('confirmyes'); yes.onclick = new Function('deleteFile("' + path + '")'); var no = document.createElement('div'); no.onclick = new Function('removeDeleteConfirm("' + path + '")'); - no.textContent = 'Cancel'; + no.textContent = localStrings.getString('confirmcancel'); no.className = 'deleteNo'; askingDiv.appendChild(yes); askingDiv.appendChild(no); @@ -901,8 +902,6 @@ function pauseToggleDownload(id) { }; function downloadsList(results) { -// alert(JSON.stringify(results)); -// We might want to do something with this... For now assume that the update will get the necessary info downloadUpdated(results); }; @@ -937,16 +936,16 @@ function downloadUpdated(results) { if (results[x].state == "DANGEROUS") { pauseDiv.onClick = undefined; var prompt = document.createElement('div'); - prompt.textContent = 'Allow Download?'; + prompt.textContent = localStrings.getString('allowdownload'); prompt.className = 'prompt'; pauseDiv.appendChild(prompt); var yes = document.createElement('div'); yes.className = 'link'; - yes.textContent = 'yes'; + yes.textContent = localStrings.getString('confirmyes'); yes.onclick = new Function('allowDownload(' + results[x].id +')'); var no = document.createElement('div'); no.onclick = new Function('cancelDownload(' + results[x].id +')'); - no.textContent = 'no'; + no.textContent = localStrings.getString('confirmcancel'); no.className = 'link'; pauseDiv.appendChild(yes); pauseDiv.appendChild(no); @@ -983,7 +982,6 @@ function downloadUpdated(results) { if (element && results[x].file_path.indexOf(pathArray[currentNode]) >= 0) { chrome.send("refreshDirectory", [pathArray[currentNode]]); } - // TODO(dhg):Get the new file } } }; @@ -1019,6 +1017,9 @@ function dialogNewFolderClick() { * Window onload handler, sets up the page. */ function load() { + localStrings = new LocalStrings(); + kPauseDownload = localStrings.getString('pause'); + kResumeDownload = localStrings.getString('resume'); mainColumn = $('main'); if(document.documentElement.clientWidth <= 600) { inFullMode = false; @@ -1050,18 +1051,18 @@ function load() { savebutton.id = 'savebutton'; savebutton.className = 'filebutton openbutton disabled'; savebutton.onclick = dialogSaveClick; - savebutton.textContent = 'Save'; + savebutton.textContent = localStrings.getString('save'); savemenu.appendChild(savebutton); var cancelbutton = document.createElement('div'); cancelbutton.className = 'filebutton cancelbutton'; savemenu.appendChild(cancelbutton); - cancelbutton.textContent = 'Cancel'; + cancelbutton.textContent = localStrings.getString('confirmcancel'); cancelbutton.onclick = dialogCancelClick; var filenameprompt = document.createElement('div'); filenameprompt.className = 'filenameprompt'; - filenameprompt.textContent = 'File name:'; + filenameprompt.textContent = localStrings.getString('filenameprompt'); savemenu.appendChild(filenameprompt); var filename = document.createElement('input'); @@ -1073,7 +1074,7 @@ function load() { var newfolderbutton = document.createElement('div'); newfolderbutton.id = 'newfolderbutton'; newfolderbutton.className = 'filebutton newfolderbutton disabled'; - newfolderbutton.textContent = 'New Folder'; + newfolderbutton.textContent = localStrings.getString('newfolder'); newfolderbutton.onclick = dialogNewFolderClick; savemenu.appendChild(newfolderbutton); @@ -1093,8 +1094,8 @@ function load() { openbutton.onclick = dialogOkClick; openmenu.appendChild(cancelbutton); cancelbutton.onclick = dialogCancelClick; - openbutton.textContent = 'Open'; - cancelbutton.textContent = 'Cancel'; + openbutton.textContent = localStrings.getString('open'); + cancelbutton.textContent = localStrings.getString('confirmcancel'); document.body.appendChild(openmenu); } } @@ -1342,9 +1343,9 @@ function createNewItem(title, path, isDirectory) { var picasaitem = document.createElement('div'); var flikritem = document.createElement('div'); var emailitem = document.createElement('div'); - picasaitem.textContent = 'Picasa Web'; - flikritem.textContent = 'Flikr'; - emailitem.textContent = 'Email'; + picasaitem.textContent = localStrings.getString('picasaweb');; + flikritem.textContent = localStrings.getString('flikr'); + emailitem.textContent = localStrings.getString('email'); picasaitem.className = 'menuitem'; flikritem.className = 'menuitemdisabled'; emailitem.className = 'menuitemdisabled'; @@ -1354,7 +1355,7 @@ function createNewItem(title, path, isDirectory) { menu.appendChild(emailitem); } var deleteitem = document.createElement('div'); - deleteitem.textContent = 'Delete'; + deleteitem.textContent = localStrings.getString('delete'); deleteitem.className = 'menuitem'; deleteitem.onclick = new Function('deleteFileConfirm("' + path +'")'); menu.appendChild(deleteitem); |