summaryrefslogtreecommitdiffstats
path: root/chrome/common/l10n_util.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 19:31:09 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 19:31:09 +0000
commit2674971542ef049b13ddad5dc1ac77fa9b16f498 (patch)
treefaae032905d7fafbedeee45b440ac3b9be678b56 /chrome/common/l10n_util.cc
parentf06c262be1375eb6fc880dc044186653f873f665 (diff)
downloadchromium_src-2674971542ef049b13ddad5dc1ac77fa9b16f498.zip
chromium_src-2674971542ef049b13ddad5dc1ac77fa9b16f498.tar.gz
chromium_src-2674971542ef049b13ddad5dc1ac77fa9b16f498.tar.bz2
Switch ResourceBundle::GetLocalizedString to return a string16 instead
of a wstring. This saves us a conversion to wstring on linux when getting utf8 strings. BUG=9911 Review URL: http://codereview.chromium.org/67134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/l10n_util.cc')
-rw-r--r--chrome/common/l10n_util.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/common/l10n_util.cc b/chrome/common/l10n_util.cc
index cdb65d7..2b47e5f 100644
--- a/chrome/common/l10n_util.cc
+++ b/chrome/common/l10n_util.cc
@@ -293,12 +293,13 @@ std::wstring GetLocalName(const std::string& locale_code_str,
}
std::wstring GetString(int message_id) {
- ResourceBundle &rb = ResourceBundle::GetSharedInstance();
- return rb.GetLocalizedString(message_id);
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ return UTF16ToWide(rb.GetLocalizedString(message_id));
}
std::string GetStringUTF8(int message_id) {
- return WideToUTF8(GetString(message_id));
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ return UTF16ToUTF8(rb.GetLocalizedString(message_id));
}
static string16 GetStringF(int message_id,
@@ -307,9 +308,8 @@ static string16 GetStringF(int message_id,
const string16& c,
const string16& d,
std::vector<size_t>* offsets) {
- // TODO(tc): ResourceBundle::GetLocalizedString should return a string16
- // so we can avoid this conversion on linux/mac.
- const string16& format_string = WideToUTF16(GetString(message_id));
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ const string16& format_string = rb.GetLocalizedString(message_id);
string16 formatted = ReplaceStringPlaceholders(format_string, a, b, c, d,
offsets);
return formatted;