diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-07-12 17:07:19 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-07-12 17:07:19 +0000 |
commit | e2bb8aa49243734ea094c0c81a072f7570507d95 (patch) | |
tree | e484921bc047c953593819787ff91f49af2daa20 /AppKit/GTMUILocalizer.m | |
parent | 4d5b01da0879f09e3777cf423bed5d3db5d2e149 (diff) |
[Author: rsesek]
Add support for NSSegmentedControl to GTMUILocalizer.
This fixes http://code.google.com/p/google-toolbox-for-mac/issues/detail?id=53.
R=dmaclach
APPROVED=dmaclach
DELTA=142 (137 added, 1 deleted, 4 changed)
Diffstat (limited to 'AppKit/GTMUILocalizer.m')
-rw-r--r-- | AppKit/GTMUILocalizer.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/AppKit/GTMUILocalizer.m b/AppKit/GTMUILocalizer.m index 16d00dd..56b0b7d 100644 --- a/AppKit/GTMUILocalizer.m +++ b/AppKit/GTMUILocalizer.m @@ -276,6 +276,16 @@ [self localizeObject:[column headerCell] recursively:recursive]; } } + + // Do NSSegmentedControl segments. + if ([view isKindOfClass:[NSSegmentedControl class]]) { + NSSegmentedControl *segmentedControl = (NSSegmentedControl *)view; + for (NSInteger i = 0; i < [segmentedControl segmentCount]; ++i) { + NSString *label = [segmentedControl labelForSegment:i]; + [segmentedControl setLabel:[self localizedStringForString:label] + forSegment:i]; + } + } } - (void)localizeMenu:(NSMenu *)menu recursively:(BOOL)recursive { |