diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 19:26:36 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 19:26:36 +0000 |
commit | aff5eec98954766821f46a7e9fab07b7007f0319 (patch) | |
tree | f1f93210978317adc3ca097e49486cf79035c389 /app/l10n_util_mac.h | |
parent | 086eaec4d8ed6b6207925253f17fdabef82a0ed7 (diff) | |
download | chromium_src-aff5eec98954766821f46a7e9fab07b7007f0319.zip chromium_src-aff5eec98954766821f46a7e9fab07b7007f0319.tar.gz chromium_src-aff5eec98954766821f46a7e9fab07b7007f0319.tar.bz2 |
Move some Mac l10n helpers out into app/l10n so they are closer to the generic ones.
Complete the apis points so the ones folks might need are all there already.
Switch the code using the old calls over to the new helpers.
TEST=no l10n stuff broke
BUG=none
Review URL: http://codereview.chromium.org/165132
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/l10n_util_mac.h')
-rw-r--r-- | app/l10n_util_mac.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/app/l10n_util_mac.h b/app/l10n_util_mac.h new file mode 100644 index 0000000..87ccb05 --- /dev/null +++ b/app/l10n_util_mac.h @@ -0,0 +1,68 @@ +// Copyright (c) 2009 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. + +#ifndef APP_L10N_UTIL_MAC_H_ +#define APP_L10N_UTIL_MAC_H_ + +#include "app/l10n_util.h" +#include "base/basictypes.h" +#include "base/string16.h" + +#ifdef __OBJC__ +@class NSString; +#else +class NSString; +#endif + +namespace l10n_util { + +// Remove the Windows-style accelerator marker (for labels, menuitems, etc.) +// and change "..." into an ellipsis. +// Returns the result in an autoreleased NSString. +NSString* FixUpWindowsStyleLabel(const string16& label); + +// Pulls resource string from the string bundle and returns it. +NSString* GetNSString(int message_id); + +// Get a resource string and replace $1-$2-$3 with |a| and |b| +// respectively. Additionally, $$ is replaced by $. +NSString* GetNSStringF(int message_id, + const string16& a); +NSString* GetNSStringF(int message_id, + const string16& a, + const string16& b); +NSString* GetNSStringF(int message_id, + const string16& a, + const string16& b, + const string16& c); +NSString* GetNSStringF(int message_id, + const string16& a, + const string16& b, + const string16& c, + const string16& d); + +// Same as GetNSString, but runs the result through FixUpWindowsStyleLabel +// before returning it. +NSString* GetNSStringWithFixup(int message_id); + +// Same as GetNSStringF, but runs the result through FixUpWindowsStyleLabel +// before returning it. +NSString* GetNSStringFWithFixup(int message_id, + const string16& a); +NSString* GetNSStringFWithFixup(int message_id, + const string16& a, + const string16& b); +NSString* GetNSStringFWithFixup(int message_id, + const string16& a, + const string16& b, + const string16& c); +NSString* GetNSStringFWithFixup(int message_id, + const string16& a, + const string16& b, + const string16& c, + const string16& d); + +} // namespace l10n_util + +#endif // APP_L10N_UTIL_MAC_H_ |