summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-18 22:02:39 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-18 22:02:39 +0000
commit3851091de6451d26ba85318a9c36bd7f2923d2d8 (patch)
treec9bb6f126ca7940bb16e5aca6ccce464427a2823 /chrome/common
parent1d942ca72e87a91a6ce3ef9db4d82e1b3b53eb6d (diff)
downloadchromium_src-3851091de6451d26ba85318a9c36bd7f2923d2d8.zip
chromium_src-3851091de6451d26ba85318a9c36bd7f2923d2d8.tar.gz
chromium_src-3851091de6451d26ba85318a9c36bd7f2923d2d8.tar.bz2
Revert "load strings and display them on linux" because linux unittests broke.
This reverts commit r9972. TBR=evan Review URL: http://codereview.chromium.org/21478 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9979 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/l10n_util.cc8
-rw-r--r--chrome/common/resource_bundle_linux.cc17
2 files changed, 6 insertions, 19 deletions
diff --git a/chrome/common/l10n_util.cc b/chrome/common/l10n_util.cc
index a8749c8..dbe34c7 100644
--- a/chrome/common/l10n_util.cc
+++ b/chrome/common/l10n_util.cc
@@ -17,11 +17,9 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/gfx/chrome_canvas.h"
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN)
// TODO(port): re-enable.
#include "chrome/common/resource_bundle.h"
-#endif
-#if defined(OS_WIN)
#include "chrome/views/view.h"
#endif // defined(OS_WIN)
#include "unicode/coll.h"
@@ -327,7 +325,7 @@ std::wstring GetLocalName(const std::wstring& locale_code_wstr,
}
std::wstring GetString(int message_id) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN)
ResourceBundle &rb = ResourceBundle::GetSharedInstance();
return rb.GetLocalizedString(message_id);
#else
@@ -343,7 +341,7 @@ static std::wstring GetStringF(int message_id,
const std::wstring& c,
const std::wstring& d,
std::vector<size_t>* offsets) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN)
// TODO(port): re-enable.
const std::wstring& format_string = GetString(message_id);
std::wstring formatted = ReplaceStringPlaceholders(format_string, a, b, c,
diff --git a/chrome/common/resource_bundle_linux.cc b/chrome/common/resource_bundle_linux.cc
index 12b0858..1cb8307 100644
--- a/chrome/common/resource_bundle_linux.cc
+++ b/chrome/common/resource_bundle_linux.cc
@@ -37,15 +37,7 @@ void ResourceBundle::LoadResources(const std::wstring& pref_locale) {
bool success = resources_data_->Load(resources_data_path);
DCHECK(success) << "failed to load chrome.pak";
- FilePath locale_path;
- PathService::Get(chrome::DIR_LOCALES, &locale_path);
- // TODO(tc): Handle other locales properly.
- NOTIMPLEMENTED() << " loading en-US strings only";
- locale_path = locale_path.Append(FILE_PATH_LITERAL("en-US.pak"));
- DCHECK(locale_resources_data_ == NULL) << "locale data already loaded!";
- locale_resources_data_ = new base::DataPack;
- success = locale_resources_data_->Load(locale_path);
- DCHECK(success) << "failed to load locale pak file";
+ // TODO(tc): Load the .pak file for locale_resources_data_.
}
FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) {
@@ -108,9 +100,6 @@ std::wstring ResourceBundle::GetLocalizedString(int message_id) {
return std::wstring();
}
}
-
- // Data pack encodes strings as UTF16.
- string16 msg(reinterpret_cast<const char16*>(data.data()),
- data.length() / 2);
- return UTF16ToWide(msg);
+ // Copy into a wstring and return.
+ return UTF8ToWide(data.as_string());
}