1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_BASE_L10N_L10N_UTIL_MAC_H_
6 #define UI_BASE_L10N_L10N_UTIL_MAC_H_
11 #include "base/basictypes.h"
12 #include "base/strings/string16.h"
13 #include "ui/base/ui_export.h"
23 // Remove the Windows-style accelerator marker (for labels, menuitems, etc.)
24 // and change "..." into an ellipsis.
25 // Returns the result in an autoreleased NSString.
26 UI_EXPORT NSString* FixUpWindowsStyleLabel(const string16& label);
28 // Pulls resource string from the string bundle and returns it.
29 UI_EXPORT NSString* GetNSString(int message_id);
31 // Get a resource string and replace $1-$2-$3 with |a| and |b|
32 // respectively. Additionally, $$ is replaced by $.
33 UI_EXPORT NSString* GetNSStringF(int message_id,
35 UI_EXPORT NSString* GetNSStringF(int message_id,
38 UI_EXPORT NSString* GetNSStringF(int message_id,
42 UI_EXPORT NSString* GetNSStringF(int message_id,
48 // Variants that return the offset(s) of the replaced parameters. (See
49 // app/l10n_util.h for more details.)
50 UI_EXPORT NSString* GetNSStringF(int message_id,
53 std::vector<size_t>* offsets);
55 // Same as GetNSString, but runs the result through FixUpWindowsStyleLabel
56 // before returning it.
57 UI_EXPORT NSString* GetNSStringWithFixup(int message_id);
59 // Same as GetNSStringF, but runs the result through FixUpWindowsStyleLabel
60 // before returning it.
61 UI_EXPORT NSString* GetNSStringFWithFixup(int message_id,
63 UI_EXPORT NSString* GetNSStringFWithFixup(int message_id,
66 UI_EXPORT NSString* GetNSStringFWithFixup(int message_id,
70 UI_EXPORT NSString* GetNSStringFWithFixup(int message_id,
76 // Support the override of the locale with the value from Cocoa.
77 UI_EXPORT void OverrideLocaleWithCocoaLocale();
78 UI_EXPORT const std::string& GetLocaleOverride();
80 } // namespace l10n_util
82 #endif // UI_BASE_L10N_L10N_UTIL_MAC_H_