summaryrefslogtreecommitdiffstats
path: root/app/l10n_util.cc
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-14 00:21:58 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-14 00:21:58 +0000
commit0078ffb91ddeea8c35cdd75ffe161623030d8dbf (patch)
tree96089176d6afd0030fa4eb77a8b6ca7bcbb4ec59 /app/l10n_util.cc
parent849a62a1aa77e5d7887bc310233d86cf33ebf393 (diff)
downloadchromium_src-0078ffb91ddeea8c35cdd75ffe161623030d8dbf.zip
chromium_src-0078ffb91ddeea8c35cdd75ffe161623030d8dbf.tar.gz
chromium_src-0078ffb91ddeea8c35cdd75ffe161623030d8dbf.tar.bz2
Allow the new tab page to be themed (you may want to review DOMUIThemeSource as a whole and not just these changes).
Change global std::strings to chars* in browser theme provider. Add ability for ReplaceStringPlaceHolder to take up to 9 replacements. BUG=11235,11685 Review URL: http://codereview.chromium.org/115172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/l10n_util.cc')
-rw-r--r--app/l10n_util.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc
index 285b8ab..15b4211 100644
--- a/app/l10n_util.cc
+++ b/app/l10n_util.cc
@@ -312,7 +312,12 @@ static string16 GetStringF(int message_id,
std::vector<size_t>* offsets) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
const string16& format_string = rb.GetLocalizedString(message_id);
- string16 formatted = ReplaceStringPlaceholders(format_string, a, b, c, d,
+ std::vector<const string16> subst;
+ subst.push_back(a);
+ subst.push_back(b);
+ subst.push_back(c);
+ subst.push_back(d);
+ string16 formatted = ReplaceStringPlaceholders(format_string, subst,
offsets);
return formatted;
}
@@ -337,6 +342,15 @@ std::wstring GetStringF(int message_id,
WideToUTF16(c), string16(), NULL));
}
+std::wstring GetStringF(int message_id,
+ const std::wstring& a,
+ const std::wstring& b,
+ const std::wstring& c,
+ const std::wstring& d) {
+ return UTF16ToWide(GetStringF(message_id, WideToUTF16(a), WideToUTF16(b),
+ WideToUTF16(c), WideToUTF16(d), NULL));
+}
+
std::string GetStringFUTF8(int message_id,
const string16& a) {
return UTF16ToUTF8(GetStringF(message_id, a, string16(), string16(),
@@ -357,6 +371,14 @@ std::string GetStringFUTF8(int message_id,
return UTF16ToUTF8(GetStringF(message_id, a, b, c, string16(), NULL));
}
+std::string GetStringFUTF8(int message_id,
+ const string16& a,
+ const string16& b,
+ const string16& c,
+ const string16& d) {
+ return UTF16ToUTF8(GetStringF(message_id, a, b, c, d, NULL));
+}
+
std::wstring GetStringF(int message_id, const std::wstring& a, size_t* offset) {
DCHECK(offset);
std::vector<size_t> offsets;