aboutsummaryrefslogtreecommitdiffstats
path: root/Framework/MASLocalization.m
blob: 431fc5f47b93c77a3e9271183c7c9e6fa7e72876 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#import "MASLocalization.h"
#import "MASShortcut.h"

// The CocoaPods trickery here is needed because when then code
// is built as a part of CocoaPods, it wont make a separate framework
// and the Localized.strings file wont be bundled correctly.
// See https://github.com/shpakovski/MASShortcut/issues/74
NSString *MASLocalizedString(NSString *key, NSString *comment) {
    NSBundle *frameworkBundle = nil;
#ifdef COCOAPODS
    NSURL *bundleURL = [[NSBundle mainBundle] URLForResource:@"MASShortcut" withExtension:@"bundle"];
    frameworkBundle = [NSBundle bundleWithURL:bundleURL];
#else
    frameworkBundle = [NSBundle bundleForClass:[MASShortcut class]];
#endif
    return [frameworkBundle localizedStringForKey:key value:@"XXX" table:@"Localizable"];
}