summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 20:44:42 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 20:44:42 +0000
commit388e64f37294ba64e2cdd2ebe8cb72075472fff3 (patch)
treede1a5a1587069b4e7978418852ccc985dd2ee95a /app
parent7b4981ebb0181c44c3ed004f7389617cae8d2b41 (diff)
downloadchromium_src-388e64f37294ba64e2cdd2ebe8cb72075472fff3.zip
chromium_src-388e64f37294ba64e2cdd2ebe8cb72075472fff3.tar.gz
chromium_src-388e64f37294ba64e2cdd2ebe8cb72075472fff3.tar.bz2
Mac: add a l10n_util::GetNSStringF() which gets offsets as well.
... and get rid of a wstring. (More string16 versions of GetStringF() and corresponding versions GetNSStringF() should be implemented.) BUG=none TEST=on a branded build (on Mac), in the about dialog, make sure the text is still correct and the links still work correctly Review URL: http://codereview.chromium.org/2042002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/l10n_util_mac.h9
-rw-r--r--app/l10n_util_mac.mm10
2 files changed, 17 insertions, 2 deletions
diff --git a/app/l10n_util_mac.h b/app/l10n_util_mac.h
index 995d191..e7ce5b0 100644
--- a/app/l10n_util_mac.h
+++ b/app/l10n_util_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -42,6 +42,13 @@ NSString* GetNSStringF(int message_id,
const string16& c,
const string16& d);
+// Variants that return the offset(s) of the replaced parameters. (See
+// app/l10n_util.h for more details.)
+NSString* GetNSStringF(int message_id,
+ const string16& a,
+ const string16& b,
+ std::vector<size_t>* offsets);
+
// Same as GetNSString, but runs the result through FixUpWindowsStyleLabel
// before returning it.
NSString* GetNSStringWithFixup(int message_id);
diff --git a/app/l10n_util_mac.mm b/app/l10n_util_mac.mm
index 9861f14..97db5b1 100644
--- a/app/l10n_util_mac.mm
+++ b/app/l10n_util_mac.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -118,6 +118,14 @@ NSString* GetNSStringF(int message_id,
a, b, c, d));
}
+NSString* GetNSStringF(int message_id,
+ const string16& a,
+ const string16& b,
+ std::vector<size_t>* offsets) {
+ return base::SysUTF16ToNSString(l10n_util::GetStringFUTF16(message_id,
+ a, b, offsets));
+}
+
NSString* GetNSStringWithFixup(int message_id) {
return FixUpWindowsStyleLabel(l10n_util::GetStringUTF16(message_id));
}