-
Notifications
You must be signed in to change notification settings - Fork 2
/
LocalizedInterface.m
93 lines (79 loc) · 1.88 KB
/
LocalizedInterface.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* LoacalizedInterface.m
* MPlayer OS X
*
* Created by Jan Volf on Thu Dec 05 2002.
* Copyright (c) 2003 Jan Volf. All rights reserved.
*/
#import "LocalizedInterface.h"
@implementation NSMenu (Localization)
- (void) awakeFromNib
{
[self setTitle:NSLocalizedString([self title],@"")];
}
@end
@implementation NSMenuItem (Localization)
- (void) awakeFromNib
{
[self setTitle:NSLocalizedString([self title],@"")];
}
@end
@implementation NSCell (Localization)
- (void) awakeFromNib
{
[self setStringValue:NSLocalizedString([self stringValue],@"")];
}
@end
@implementation NSButton (Localization)
- (void) awakeFromNib
{
if ([self imagePosition] != NSImageOnly) {
[self setTitle:NSLocalizedString([self title],@"")];
[self setAlternateTitle:NSLocalizedString([self alternateTitle],@"")];
}
if ([self toolTip])
[self setToolTip:NSLocalizedString([self toolTip],@"")];
}
@end
@implementation NSSlider (Localization)
- (void) awakeFromNib
{
if ([self toolTip])
[self setToolTip:NSLocalizedString([self toolTip],@"")];
}
@end
@implementation NSTextField (Localization)
- (void) awakeFromNib
{
[self setStringValue:NSLocalizedString([self stringValue],@"")];
if ([self toolTip])
[self setToolTip:NSLocalizedString([self toolTip],@"")];
}
@end
@implementation NSWindow (Localization)
- (void) awakeFromNib
{
[self setTitle:NSLocalizedString([self title],@"")];
}
@end
@implementation NSTabViewItem (Localization)
- (void) awakeFromNib
{
[self setLabel:NSLocalizedString([self label],@"")];
}
@end
@implementation NSTableColumn (Localization)
- (void) awakeFromNib
{
[[self headerCell] setStringValue:NSLocalizedString([[self headerCell] stringValue],@"")];
}
@end
@implementation NSBox (Localization)
- (void) awakeFromNib
{
[self setTitle:NSLocalizedString([self title],@"")];
if ([self toolTip])
[self setToolTip:NSLocalizedString([self toolTip],@"")];
}
@end