mirror of
https://github.com/tappollo/Xcode-Quick-Localization.git
synced 2026-01-12 16:05:06 +08:00
register defaults to fix a crash
This commit is contained in:
@@ -11,4 +11,5 @@ extern NSUInteger QL_CountOccurentOfStringWithSubString(NSString *str, NSString
|
||||
|
||||
@interface OLSettingController : NSWindowController
|
||||
@property (nonatomic, weak) NSBundle *bundle;
|
||||
+ (void)registerFormatStringDefaults;
|
||||
@end
|
||||
|
||||
@@ -162,4 +162,8 @@ NSUInteger QL_CountOccurentOfStringWithSubString(NSString *str, NSString *subStr
|
||||
|
||||
return savedFormatString;
|
||||
}
|
||||
|
||||
+ (void)registerFormatStringDefaults {
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:@{kQLFormatStringKey: @"NSLocalizedString(%@, %@)"}];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -72,6 +72,7 @@ static id sharedPlugin = nil;
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
|
||||
[self createMenuItem];
|
||||
[OLSettingController registerFormatStringDefaults];
|
||||
}
|
||||
|
||||
- (void)createMenuItem {
|
||||
|
||||
Reference in New Issue
Block a user