summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 22:40:57 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 22:40:57 +0000
commitdff6d13ca6ddb778867ce2d731d5f8093aef28ea (patch)
tree4758c346a2af607ec2a842c24f222e8fc401b6a8 /app
parent05062e288e4b8f174a79cc698c3c97d7d12975be (diff)
downloadchromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.zip
chromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.tar.gz
chromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.tar.bz2
Re-land of earlier NTP theme patch; now with mac and linux compatibility.
Review URL: http://codereview.chromium.org/115413 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/l10n_util.cc24
-rw-r--r--app/l10n_util.h10
2 files changed, 33 insertions, 1 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc
index 8791024..1fb06af 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<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;
diff --git a/app/l10n_util.h b/app/l10n_util.h
index bbf04eb..0fe391c 100644
--- a/app/l10n_util.h
+++ b/app/l10n_util.h
@@ -79,6 +79,11 @@ std::wstring GetStringF(int message_id,
const std::wstring& a,
const std::wstring& b,
const std::wstring& c);
+std::wstring GetStringF(int message_id,
+ const std::wstring& a,
+ const std::wstring& b,
+ const std::wstring& c,
+ const std::wstring& d);
std::string GetStringFUTF8(int message_id,
const string16& a);
std::string GetStringFUTF8(int message_id,
@@ -88,6 +93,11 @@ std::string GetStringFUTF8(int message_id,
const string16& a,
const string16& b,
const string16& c);
+std::string GetStringFUTF8(int message_id,
+ const string16& a,
+ const string16& b,
+ const string16& c,
+ const string16& d);
// Variants that return the offset(s) of the replaced parameters. The
// vector based version returns offsets ordered by parameter. For example if