summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 00:57:18 +0000
committerjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 00:57:18 +0000
commit8acb6458b8258dc45c2027b2606eacbdc389b909 (patch)
treee62c70c8ba2bba8b1e7570ac99296aeea4496106 /chrome
parent70d3e6e9698d1a532bb916cf5eb876daf9aef2f4 (diff)
downloadchromium_src-8acb6458b8258dc45c2027b2606eacbdc389b909.zip
chromium_src-8acb6458b8258dc45c2027b2606eacbdc389b909.tar.gz
chromium_src-8acb6458b8258dc45c2027b2606eacbdc389b909.tar.bz2
A trivial fix for localizing 'Bookmark bar' (folder name) in exported 'bookmark
s.html' file. Update the unit test to match the change in bookmark_html_writer.cc The initial CL got reverted because the unittest failed. This CL changes the unittest. BUG=6957 Review URL: http://codereview.chromium.org/48042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/bookmarks/bookmark_html_writer.cc4
-rw-r--r--chrome/browser/bookmarks/bookmark_html_writer_unittest.cc12
2 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
index b3ed5af..de4c4ad 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -15,6 +15,8 @@
#include "chrome/browser/bookmarks/bookmark_codec.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/history/history_types.h"
+#include "chrome/common/l10n_util.h"
+#include "grit/generated_resources.h"
#include "net/base/escape.h"
#include "net/base/file_stream.h"
#include "net/base/net_errors.h"
@@ -257,7 +259,7 @@ class Writer : public Task {
if (folder_type == history::StarredEntry::BOOKMARK_BAR) {
if (!Write(kBookmarkBar))
return false;
- title = L"Bookmark Bar";
+ title = l10n_util::GetString(IDS_BOOMARK_BAR_FOLDER_NAME);
} else if (!Write(kFolderAttributeEnd)) {
return false;
}
diff --git a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
index 8f0ad23..b34b14c 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
@@ -60,7 +60,7 @@ class BookmarkHTMLWriterTest : public testing::Test {
// way of bookmark_html_writer, then using the importer to read it back in.
TEST_F(BookmarkHTMLWriterTest, Test) {
// Populate the BookmarkModel. This creates the following bookmark structure:
- // Bookmark Bar
+ // Bookmarks bar
// F1
// url1
// F2
@@ -110,12 +110,16 @@ TEST_F(BookmarkHTMLWriterTest, Test) {
// Verify we got back what we wrote.
ASSERT_EQ(6U, parsed_bookmarks.size());
+ // Hardcode the value of IDS_BOOKMARK_BAR_FOLDER_NAME in en-US locale
+ // because all the unit tests are run in en-US locale.
+ const wchar_t* kBookmarkBarFolderName = L"Bookmarks bar";
AssertBookmarkEntryEquals(parsed_bookmarks[0], false, url1, url1_title, t1,
- L"Bookmark Bar", f1_title, std::wstring());
+ kBookmarkBarFolderName, f1_title, std::wstring());
AssertBookmarkEntryEquals(parsed_bookmarks[1], false, url2, url2_title, t2,
- L"Bookmark Bar", f1_title, f2_title);
+ kBookmarkBarFolderName, f1_title, f2_title);
AssertBookmarkEntryEquals(parsed_bookmarks[2], false, url3, url3_title, t3,
- L"Bookmark Bar", std::wstring(), std::wstring());
+ kBookmarkBarFolderName, std::wstring(),
+ std::wstring());
AssertBookmarkEntryEquals(parsed_bookmarks[3], false, url1, url1_title, t1,
std::wstring(), std::wstring(), std::wstring());
AssertBookmarkEntryEquals(parsed_bookmarks[4], false, url2, url2_title, t2,