diff options
| author | Tomáš Znamenáček | 2015-10-08 11:26:27 +0200 |
|---|---|---|
| committer | Tomáš Znamenáček | 2015-10-08 11:26:27 +0200 |
| commit | ed694bc1a54da3407a1dfec5bb40e51b187ce714 (patch) | |
| tree | 978121a3c8cedf63f8014a427c72dab216024816 | |
| parent | b99a1a4dc431e90b3404cfc1f15b0dd7c2846323 (diff) | |
| parent | ded95506c6bc8f6c839b1efaf2fc04923498e894 (diff) | |
| download | MASShortcut-ed694bc1a54da3407a1dfec5bb40e51b187ce714.tar.bz2 | |
Merge pull request #75 from beaufour/master
Fixed localization when used from CocoaPods.
| -rw-r--r-- | Framework/MASLocalization.m | 8 | ||||
| -rw-r--r-- | MASShortcut.podspec | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Framework/MASLocalization.m b/Framework/MASLocalization.m index 7f395a9..a36d3a4 100644 --- a/Framework/MASLocalization.m +++ b/Framework/MASLocalization.m @@ -2,6 +2,12 @@ #import "MASShortcut.h" NSString *MASLocalizedString(NSString *key, NSString *comment) { - NSBundle *frameworkBundle = [NSBundle bundleForClass:[MASShortcut class]]; + 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"]; } diff --git a/MASShortcut.podspec b/MASShortcut.podspec index 2b66035..8369046 100644 --- a/MASShortcut.podspec +++ b/MASShortcut.podspec @@ -1,3 +1,4 @@ +# coding: utf-8 Pod::Spec.new do |s| s.name = 'MASShortcut' s.version = '2.3.1' @@ -14,4 +15,5 @@ Pod::Spec.new do |s| s.exclude_files = 'Framework/*Tests.m' s.osx.frameworks = 'Carbon', 'AppKit' s.requires_arc = true + s.osx.resource_bundles = { 'MASShortcut' => ['*.lproj'] } end |
