Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/cocoa/ui_localizer.h

Issue 159197: Add a custom subclass of GTMUILocalizer that skips the bundle work so we can ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/mac/generate_localizer ('k') | chrome/browser/cocoa/ui_localizer.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_COCOA_UI_LOCALIZER_H_ 5 #ifndef CHROME_BROWSER_COCOA_UI_LOCALIZER_H_
6 #define CHROME_BROWSER_COCOA_UI_LOCALIZER_H_ 6 #define CHROME_BROWSER_COCOA_UI_LOCALIZER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #import "third_party/GTM/AppKit/GTMUILocalizer.h"
10 11
11 @class NSString; 12 @class NSString;
12 13
13 namespace ui_localizer { 14 namespace ui_localizer {
14 15
15 // Remove the Windows-style accelerator marker and change "..." into an 16 // Remove the Windows-style accelerator marker and change "..." into an
16 // ellipsis. Returns the result in an autoreleased NSString. 17 // ellipsis. Returns the result in an autoreleased NSString.
17 NSString* FixUpWindowsStyleLabel(const string16& label); 18 NSString* FixUpWindowsStyleLabel(const string16& label);
18 19
19 struct ResourceMap { 20 struct ResourceMap {
20 const char* const name; 21 const char* const name;
21 unsigned int label_id; 22 unsigned int label_id;
22 unsigned int label_arg_id; 23 unsigned int label_arg_id;
23 }; 24 };
24 25
25 NSString* LocalizedStringForKeyFromMapList(NSString* key, 26 NSString* LocalizedStringForKeyFromMapList(NSString* key,
26 const ResourceMap* map_list, 27 const ResourceMap* map_list,
27 size_t map_list_len); 28 size_t map_list_len);
28 29
29 } // namespace ui_localizer 30 } // namespace ui_localizer
30 31
32 // A base class for generated localizers.
33 //
34 // To use this, have the build run generate_localizer on your xib file (see
35 // chrome.gyp). Then add an instance of the generated subclass to the xib.
36 // Connect the owner_ outlet of the instance to the "File's Owner" of the xib.
37 // It expects the owner_ outlet to be an instance or subclass of
38 // NSWindowController or NSViewController. It will then localize any items in
39 // the NSWindowController's window and subviews, or the NSViewController's view
40 // and subviews, when awakeFromNib is called on the instance. You can
41 // optionally hook up otherObjectToLocalize_ and yetAnotherObjectToLocalize_ and
42 // those will also be localized. Strings in the xib that you want localized must
43 // start with ^IDS. The value must be a valid resource constant.
44 // Things that will be localized are:
45 // - Titles and altTitles (for menus, buttons, windows, menuitems, -tabViewItem)
46 // - -stringValue (for labels)
47 // - tooltips
48 // - accessibility help
49 // - accessibility descriptions
50 // - menus
51 @interface ChromeUILocalizer : GTMUILocalizer
52 @end
53
31 #endif // CHROME_BROWSER_COCOA_UI_LOCALIZER_H_ 54 #endif // CHROME_BROWSER_COCOA_UI_LOCALIZER_H_
OLDNEW
« no previous file with comments | « build/mac/generate_localizer ('k') | chrome/browser/cocoa/ui_localizer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698