diff --git a/ProfilesManager.xcodeproj/project.pbxproj b/ProfilesManager.xcodeproj/project.pbxproj index a97a257..1377210 100755 --- a/ProfilesManager.xcodeproj/project.pbxproj +++ b/ProfilesManager.xcodeproj/project.pbxproj @@ -36,8 +36,8 @@ B804236A2192BD9100AD899F /* GitHubInstallWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B80423542192BD9000AD899F /* GitHubInstallWindowController.m */; }; B804236B2192BD9100AD899F /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B80423592192BD9000AD899F /* Info.plist */; }; B80FCFC31E4AAE480044098D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B80FCFC51E4AAE480044098D /* Localizable.strings */; }; + B81B6A782195470500A8580F /* ProfilesManagerWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B81B6A7A2195470500A8580F /* ProfilesManagerWindowController.xib */; }; B843F36E20897BAD00C1679C /* ProfilesManagerWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B843F36C20897BAD00C1679C /* ProfilesManagerWindowController.m */; }; - B843F36F20897BAD00C1679C /* ProfilesManagerWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B843F36D20897BAD00C1679C /* ProfilesManagerWindowController.xib */; }; B8BCD2401E6CEFCB00ABD2A6 /* iAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = B8BCD23F1E6CEFCB00ABD2A6 /* iAlert.m */; }; B8C823BE1E0288D9004BEAEF /* NSData+JKBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = B8C823BD1E0288D8004BEAEF /* NSData+JKBase64.m */; }; B8F694BB204D3ADF0048F3E6 /* PreviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B8F694B9204D3ADF0048F3E6 /* PreviewViewController.m */; }; @@ -99,12 +99,14 @@ B804235A2192BD9000AD899F /* GitHubRelease.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitHubRelease.h; sourceTree = ""; }; B80FCFC41E4AAE480044098D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; B80FCFC71E4AAE560044098D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; + B81B6A7B2195470A00A8580F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ProfilesManagerWindowController.xib; sourceTree = ""; }; + B81B6A7D2195471400A8580F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ProfilesManagerWindowController.strings; sourceTree = ""; }; + B81B6A7E2195472500A8580F /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/ProfilesManagerWindowController.strings"; sourceTree = ""; }; B8329CA91E4B1F7900D589F6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; B833BA561E4B1C36003FF745 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MainMenu.strings; sourceTree = ""; }; B833BA571E4B1C5C003FF745 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/MainMenu.strings"; sourceTree = ""; }; B843F36B20897BAD00C1679C /* ProfilesManagerWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProfilesManagerWindowController.h; sourceTree = ""; }; B843F36C20897BAD00C1679C /* ProfilesManagerWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProfilesManagerWindowController.m; sourceTree = ""; }; - B843F36D20897BAD00C1679C /* ProfilesManagerWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ProfilesManagerWindowController.xib; sourceTree = ""; }; B856B7801E25EDC800060107 /* ProfilesManager.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ProfilesManager.entitlements; sourceTree = ""; }; B8BCD23E1E6CEFCB00ABD2A6 /* iAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iAlert.h; sourceTree = ""; }; B8BCD23F1E6CEFCB00ABD2A6 /* iAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iAlert.m; sourceTree = ""; }; @@ -209,7 +211,7 @@ B8F694BA204D3ADF0048F3E6 /* PreviewViewController.xib */, B843F36B20897BAD00C1679C /* ProfilesManagerWindowController.h */, B843F36C20897BAD00C1679C /* ProfilesManagerWindowController.m */, - B843F36D20897BAD00C1679C /* ProfilesManagerWindowController.xib */, + B81B6A7A2195470500A8580F /* ProfilesManagerWindowController.xib */, ); path = Controller; sourceTree = ""; @@ -396,7 +398,7 @@ B804235C2192BD9100AD899F /* Install.pdf in Resources */, B804236B2192BD9100AD899F /* Info.plist in Resources */, A21193271AF1CA5B0064CA7D /* MainMenu.xib in Resources */, - B843F36F20897BAD00C1679C /* ProfilesManagerWindowController.xib in Resources */, + B81B6A782195470500A8580F /* ProfilesManagerWindowController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -474,6 +476,16 @@ name = Localizable.strings; sourceTree = ""; }; + B81B6A7A2195470500A8580F /* ProfilesManagerWindowController.xib */ = { + isa = PBXVariantGroup; + children = ( + B81B6A7B2195470A00A8580F /* Base */, + B81B6A7D2195471400A8580F /* en */, + B81B6A7E2195472500A8580F /* zh-Hans */, + ); + name = ProfilesManagerWindowController.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/ProfilesManager/AppDelegate.m b/ProfilesManager/AppDelegate.m index 7053e2e..b6c44ce 100755 --- a/ProfilesManager/AppDelegate.m +++ b/ProfilesManager/AppDelegate.m @@ -18,6 +18,7 @@ @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + _window = [[ProfilesManagerWindowController alloc] initWithWindowNibName:@"ProfilesManagerWindowController"]; _window.contentViewController = [[ProfilesManagerViewController alloc] initWithNibName:@"ProfilesManagerViewController" bundle:[NSBundle bundleForClass:[self class]]]; [_window.window orderFront:nil]; diff --git a/ProfilesManager/Base.lproj/Localizable.strings b/ProfilesManager/Base.lproj/Localizable.strings index cb6fbd7..419e993 100644 --- a/ProfilesManager/Base.lproj/Localizable.strings +++ b/ProfilesManager/Base.lproj/Localizable.strings @@ -6,18 +6,19 @@ Copyright © 2017年 Jakey. All rights reserved. */ -"move to trash" = "move to trash"; -"delete" = "delete"; -"show in finder" = "show in finder"; -"refresh table" = "refresh"; -"import profile" = "import profile"; -"export certificate file" = "export certificate file"; -"expired" = "expired"; -"valid" = "valid"; +"Move to trash" = "Move to trash"; +"Delete" = "Delete"; +"Show in finder" = "Show in finder"; +"Refresh table" = "Refresh"; +"Import profile" = "Import Profile"; +"Export Certificate File" = "Export Certificate File"; +"Expired" = "Expired"; +"Valid" = "Valid"; "Ok" = "Ok"; -"Cancel" = "Cancel"; +"Cancle" = "Cancle"; "Confirm Delete Opration" = "Confirm Delete Opration"; "Delete this profie item permanently,can't rollback!" = "Delete this profie item permanently,can't rollback!"; "Warning" = "Warning"; "are you sure move item to trash?" = "are you sure move item to trash?"; -"export" = "export"; +"Export" = "Export"; +"Beautify Filename" = "Beautify Filename"; diff --git a/ProfilesManager/Controller/ProfilesManagerWindowController.xib b/ProfilesManager/Controller/Base.lproj/ProfilesManagerWindowController.xib similarity index 84% rename from ProfilesManager/Controller/ProfilesManagerWindowController.xib rename to ProfilesManager/Controller/Base.lproj/ProfilesManagerWindowController.xib index 260e535..69b1f42 100644 --- a/ProfilesManager/Controller/ProfilesManagerWindowController.xib +++ b/ProfilesManager/Controller/Base.lproj/ProfilesManagerWindowController.xib @@ -41,20 +41,6 @@ - - - - - - - - - - - - - - diff --git a/ProfilesManager/Controller/ProfilesManagerViewController.m b/ProfilesManager/Controller/ProfilesManagerViewController.m index 4816058..ff20ef2 100755 --- a/ProfilesManager/Controller/ProfilesManagerViewController.m +++ b/ProfilesManager/Controller/ProfilesManagerViewController.m @@ -167,7 +167,7 @@ - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(NSTextFieldCel }else{ cell.textColor = [NSColor darkGrayColor]; if ([[tableColumn identifier] isEqualToString:kColumnIdentifierDetal]) { - if ([realItem.detail isEqualToString:@"expired"]) { + if ([realItem.detail isEqualToString:@"Expired"] ||[realItem.detail isEqualToString:@"过期"] ) { cell.textColor = [NSColor redColor]; } } @@ -250,7 +250,7 @@ - (void)menuWillOpen:(NSMenu *)menu NSMenuItem *gotoItemName = [menu itemWithTag:1002]; if (!gotoItemName) { - gotoItemName = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"show in finder",nil) action:@selector(gotoClick:) keyEquivalent:@""]; + gotoItemName = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"Show in Finder",nil) action:@selector(gotoClick:) keyEquivalent:@""]; [gotoItemName setTarget:self]; [gotoItemName setTag:1002]; [menu addItem:gotoItemName]; @@ -258,7 +258,7 @@ - (void)menuWillOpen:(NSMenu *)menu NSMenuItem *moveTrashItem = [menu itemWithTag:1000]; if (!moveTrashItem) { - moveTrashItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"move to trash",nil) action:@selector(moveTrashItemClick:) keyEquivalent:@""]; + moveTrashItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"Move to Trash",nil) action:@selector(moveTrashItemClick:) keyEquivalent:@""]; [moveTrashItem setTarget:self]; [moveTrashItem setTag:1000]; [menu addItem:moveTrashItem]; @@ -266,7 +266,7 @@ - (void)menuWillOpen:(NSMenu *)menu NSMenuItem *deleteItem = [menu itemWithTag:1001]; if (!deleteItem) { - deleteItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"delete",nil) action:@selector(deleteItemClick:) keyEquivalent:@""]; + deleteItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"Delete",nil) action:@selector(deleteItemClick:) keyEquivalent:@""]; [deleteItem setTarget:self]; [deleteItem setTag:1001]; [menu addItem:deleteItem]; @@ -274,17 +274,25 @@ - (void)menuWillOpen:(NSMenu *)menu NSMenuItem *exportItem = [menu itemWithTag:1003]; if (!exportItem) { - exportItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"export",nil) action:@selector(exportItemClick:) keyEquivalent:@""]; + exportItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"Export",nil) action:@selector(exportItemClick:) keyEquivalent:@""]; [exportItem setTarget:self]; [exportItem setTag:1003]; [menu addItem:exportItem]; } +// NSMenuItem *renameItem = [menu itemWithTag:1004]; +// if (!renameItem) +// { +// renameItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"Beautify Filename",nil) action:@selector(renameItemClick:) keyEquivalent:@""]; +// [renameItem setTarget:self]; +// [renameItem setTag:1004]; +// [menu addItem:renameItem]; +// } } if(menu == _mainMenu){ NSMenuItem *refreshItem = [menu itemWithTag:2000]; if (!refreshItem) { - refreshItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"refresh table",nil) action:@selector(refreshItemClick:) keyEquivalent:@""]; + refreshItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"Refresh Table",nil) action:@selector(refreshItemClick:) keyEquivalent:@""]; [refreshItem setTarget:self]; [refreshItem setTag:2000]; [menu addItem:refreshItem]; @@ -292,7 +300,7 @@ - (void)menuWillOpen:(NSMenu *)menu NSMenuItem *importItem = [menu itemWithTag:2001]; if (!importItem) { - importItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"import profile",nil) action:@selector(importItemClick:) keyEquivalent:@""]; + importItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"Import Profile",nil) action:@selector(importItemClick:) keyEquivalent:@""]; [importItem setTarget:self]; [importItem setTag:2001]; [menu addItem:importItem]; @@ -302,7 +310,7 @@ - (void)menuWillOpen:(NSMenu *)menu NSMenuItem *exportItem = [menu itemWithTag:3001]; if (!exportItem) { - exportItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"export certificate file",nil) action:@selector(exportCerItemClick:) keyEquivalent:@""]; + exportItem = [[NSMenuItem alloc] initWithTitle:JKLocalizedString(@"Export Certificate File",nil) action:@selector(exportCerItemClick:) keyEquivalent:@""]; [exportItem setTarget:self]; [exportItem setTag:3001]; [menu addItem:exportItem]; @@ -317,7 +325,7 @@ - (void)deleteItemClick:(id)sender NSInteger index = [self.treeView clickedRow]; ProfilesNode *node = [self.treeView itemAtRow:index]; - iAlert *alert = [iAlert alertWithTitle:JKLocalizedString(@"Confirm Delete Opration",nil) message:JKLocalizedString(@"Delete this profie item permanently,can't rollback!",nil) style:NSAlertStyleWarning]; + iAlert *alert = [iAlert alertWithTitle:[NSString stringWithFormat:@"%@,%@",JKLocalizedString(@"Confirm Delete Opration",nil),node.type] message:JKLocalizedString(@"Delete this profie item permanently,can't rollback!",nil) style:NSAlertStyleWarning]; [alert addCommonButtonWithTitle:JKLocalizedString(@"Ok", nil) handler:^(iAlertItem *item) { NSLog(@"deleteItem inde%zd",index); if (index == -1) return; @@ -327,7 +335,7 @@ - (void)deleteItemClick:(id)sender [self.treeView endUpdates]; [self deleteProfile:node.filePath option:YES]; - [self loadProfileFilesWithSearchWord:_searchWord]; +// [self loadProfileFilesWithSearchWord:_searchWord]; }]; [alert addButtonWithTitle:JKLocalizedString(@"Cancle", nil)]; [alert show:self.view.window]; @@ -350,28 +358,11 @@ - (void)moveTrashItemClick:(id)sender{ [self deleteProfile:node.filePath option:NO]; [self loadProfileFilesWithSearchWord:_searchWord]; }]; + [alert addButtonWithTitle:JKLocalizedString(@"Cancle", nil)]; [alert show:self.view.window]; } -//delete and move -- (BOOL)deleteProfile:(NSString*)filePath option:(BOOL)totle{ - NSError *error; - BOOL result = NO; - if (totle) { - result = [[NSFileManager defaultManager] removeItemAtPath:filePath error:&error]; - - }else{ - result = [[NSFileManager defaultManager] mr_moveFileAtPathToTrash:filePath error:&error]; - } - if(error) - { - [self showMessage:[error localizedDescription] completionHandler:^(NSModalResponse returnCode) { - - }]; - } - return result; -} //goto - (void)gotoClick:(id)sender @@ -387,7 +378,25 @@ - (void)gotoClick:(id)sender [[NSWorkspace sharedWorkspace] selectFile:node.filePath inFileViewerRootedAtPath:@""]; } } - +////beautify filename +//- (void)renameItemClick:(id)sender{ +// NSInteger index = [self.treeView clickedRow]; +// ProfilesNode *node = [self.treeView itemAtRow:index]; +// +// iAlert *alert = [iAlert alertWithTitle:JKLocalizedString(@"Warning",nil) message:JKLocalizedString(@"are you sure rename profile filename ?",nil) style:NSAlertStyleWarning]; +// [alert addCommonButtonWithTitle:JKLocalizedString(@"Ok", nil) handler:^(iAlertItem *item) { +// +// if (index == -1) return; +// if ([self renameFileAtPath:node.filePath toName:node.type]) { +// [self.treeView beginUpdates]; +// [self.treeView reloadItem:node]; +// [self.treeView endUpdates]; +// } +// }]; +// +// [alert addButtonWithTitle:JKLocalizedString(@"Cancle", nil)]; +// [alert show:self.view.window]; +//} //export Item to file - (void)exportItemClick:(id)sender { NSInteger index = [self.treeView clickedRow]; @@ -461,7 +470,47 @@ - (void)exportCerItemClick:(id)sender } } +#pragma mark --filemanager +//delete and move +- (BOOL)deleteProfile:(NSString*)filePath option:(BOOL)totle{ + NSError *error; + BOOL result = NO; + if (totle) { + result = [[NSFileManager defaultManager] removeItemAtPath:filePath error:&error]; + + }else{ + result = [[NSFileManager defaultManager] mr_moveFileAtPathToTrash:filePath error:&error]; + } + if(error) + { + [self showMessage:[error localizedDescription] completionHandler:^(NSModalResponse returnCode) { + + }]; + } + return result; +} + +//-(BOOL)renameFileAtPath:(NSString *)oldPath toName:(NSString *)toName { +// BOOL result = NO; +// NSError * error = nil; +// NSString *toPath = [[[oldPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:toName] stringByAppendingPathExtension:@"mobileprovision"]; +// +// NSString *tempFolder = [[oldPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"temp"]; +// if (![[NSFileManager defaultManager] fileExistsAtPath:tempFolder]) { +// [[NSFileManager defaultManager] createDirectoryAtPath:tempFolder withIntermediateDirectories:YES attributes:nil error:nil]; +// } +// NSString *tempPath = [tempFolder stringByAppendingPathComponent:oldPath.lastPathComponent]; +// +// result = [[NSFileManager defaultManager] copyItemAtURL:[NSURL fileURLWithPath:oldPath] toURL:[NSURL fileURLWithPath:tempPath] error:&error]; +// +// result = [[NSFileManager defaultManager] copyItemAtURL:[NSURL fileURLWithPath:tempPath] toURL:[NSURL fileURLWithPath:toPath] error:&error]; +// +// if (error){ NSLog(@"重命名失败:%@",[error localizedDescription]); +// +// } +// return result; +//} #pragma mark --alert - (void)showMessage:(NSString*)message completionHandler:(void (^)(NSModalResponse returnCode))handler{ NSAlert *alert = [[NSAlert alloc] init]; diff --git a/ProfilesManager/Controller/en.lproj/ProfilesManagerWindowController.strings b/ProfilesManager/Controller/en.lproj/ProfilesManagerWindowController.strings new file mode 100644 index 0000000..1c8ed50 --- /dev/null +++ b/ProfilesManager/Controller/en.lproj/ProfilesManagerWindowController.strings @@ -0,0 +1,18 @@ + +/* Class = "NSTextFieldCell"; placeholderString = "input search keyword"; ObjectID = "Dgc-Gr-MVo"; */ +"Dgc-Gr-MVo.placeholderString" = "input search keyword"; + +/* Class = "NSWindow"; title = "ProfileManager"; ObjectID = "F0z-JX-Cv5"; */ +"F0z-JX-Cv5.title" = "ProfileManager"; + +/* Class = "NSToolbarItem"; label = "Refresh"; ObjectID = "RbJ-X4-SVv"; */ +"RbJ-X4-SVv.label" = "Refresh"; + +/* Class = "NSToolbarItem"; paletteLabel = "Refresh"; ObjectID = "RbJ-X4-SVv"; */ +"RbJ-X4-SVv.paletteLabel" = "Refresh"; + +/* Class = "NSTextField"; ibShadowedToolTip = "search keyword"; ObjectID = "t6d-rt-sJV"; */ +"t6d-rt-sJV.ibShadowedToolTip" = "search keyword"; + +/* Class = "NSTextFieldCell"; title = "Search & Filter:"; ObjectID = "xoe-JW-DJi"; */ +"xoe-JW-DJi.title" = "Search & Filter:"; diff --git a/ProfilesManager/Controller/zh-Hans.lproj/ProfilesManagerWindowController.strings b/ProfilesManager/Controller/zh-Hans.lproj/ProfilesManagerWindowController.strings new file mode 100644 index 0000000..53cb5c8 --- /dev/null +++ b/ProfilesManager/Controller/zh-Hans.lproj/ProfilesManagerWindowController.strings @@ -0,0 +1,18 @@ + +/* Class = "NSTextFieldCell"; placeholderString = "input search keyword"; ObjectID = "Dgc-Gr-MVo"; */ +"Dgc-Gr-MVo.placeholderString" = "输入搜索过滤关键词"; + +/* Class = "NSWindow"; title = "ProfileManager"; ObjectID = "F0z-JX-Cv5"; */ +"F0z-JX-Cv5.title" = "ProfileManager"; + +/* Class = "NSToolbarItem"; label = "Refresh"; ObjectID = "RbJ-X4-SVv"; */ +"RbJ-X4-SVv.label" = "刷新"; + +/* Class = "NSToolbarItem"; paletteLabel = "Refresh"; ObjectID = "RbJ-X4-SVv"; */ +"RbJ-X4-SVv.paletteLabel" = "刷新"; + +/* Class = "NSTextField"; ibShadowedToolTip = "search keyword"; ObjectID = "t6d-rt-sJV"; */ +"t6d-rt-sJV.ibShadowedToolTip" = "搜索关键词"; + +/* Class = "NSTextFieldCell"; title = "Search & Filter:"; ObjectID = "xoe-JW-DJi"; */ +"xoe-JW-DJi.title" = "搜索 & 过滤:"; diff --git a/ProfilesManager/Info.plist b/ProfilesManager/Info.plist index 575af6d..5807bf8 100755 --- a/ProfilesManager/Info.plist +++ b/ProfilesManager/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.0 + 2.1 CFBundleSignature ???? CFBundleVersion diff --git a/ProfilesManager/Model/ProfilesNode.h b/ProfilesManager/Model/ProfilesNode.h index da74107..a059890 100755 --- a/ProfilesManager/Model/ProfilesNode.h +++ b/ProfilesManager/Model/ProfilesNode.h @@ -9,7 +9,7 @@ #import #define JKLocalizedString(key, comment) \ -(([[[NSLocale preferredLanguages] objectAtIndex:0] isEqual:@"zh-Hans"])?([[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]):([[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil])) +(([[[NSLocale preferredLanguages] objectAtIndex:0] hasPrefix:@"zh-Hans"])?([[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]):([[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil])) @interface ProfilesNode : NSObject diff --git a/ProfilesManager/Model/ProfilesNode.m b/ProfilesManager/Model/ProfilesNode.m index 70640c0..5c2c1f0 100755 --- a/ProfilesManager/Model/ProfilesNode.m +++ b/ProfilesManager/Model/ProfilesNode.m @@ -82,7 +82,7 @@ - (id)initWithRootNode:(ProfilesNode *)rootNode originInfo:(id)info key:(NSStrin if(_uuid){ NSDate *expiration = [dict objectForKey:@"ExpirationDate"]; - _detail = [[NSDate date] compare:expiration] == NSOrderedDescending ?JKLocalizedString(@"expired",nil):JKLocalizedString(@"valid",nil); + _detail = [[NSDate date] compare:expiration] == NSOrderedDescending ?JKLocalizedString(@"Expired",nil):JKLocalizedString(@"Valid",nil); _type = [dict objectForKey:@"Name"]; } diff --git a/ProfilesManager/en.lproj/Localizable.strings b/ProfilesManager/en.lproj/Localizable.strings index 0d738c7..4bb9765 100644 --- a/ProfilesManager/en.lproj/Localizable.strings +++ b/ProfilesManager/en.lproj/Localizable.strings @@ -6,18 +6,19 @@ Copyright © 2017年 Jakey. All rights reserved. */ -"move to trash" = "move to trash"; -"delete" = "delete"; -"show in finder" = "show in finder"; -"refresh table" = "refresh"; -"import profile" = "import profile"; -"export certificate file" = "export certificate file"; -"expired" = "expired"; -"valid" = "valid"; +"Move to trash" = "Move to trash"; +"Delete" = "Delete"; +"Show in finder" = "Show in finder"; +"Refresh table" = "Refresh"; +"Import profile" = "Import Profile"; +"Export Certificate File" = "Export Certificate File"; +"Expired" = "Expired"; +"Valid" = "Valid"; "Ok" = "Ok"; -"Cancel" = "Cancel"; +"Cancle" = "Cancle"; "Confirm Delete Opration" = "Confirm Delete Opration"; "Delete this profie item permanently,can't rollback!" = "Delete this profie item permanently,can't rollback!"; "Warning" = "Warning"; "are you sure move item to trash?" = "are you sure move item to trash?"; -"export" = "export"; +"Export" = "Export"; +"Beautify Filename" = "Beautify Filename"; diff --git a/ProfilesManager/zh-Hans.lproj/Localizable.strings b/ProfilesManager/zh-Hans.lproj/Localizable.strings index af631d1..415e790 100644 --- a/ProfilesManager/zh-Hans.lproj/Localizable.strings +++ b/ProfilesManager/zh-Hans.lproj/Localizable.strings @@ -6,18 +6,19 @@ Copyright © 2017年 Jakey. All rights reserved. */ -"move to trash" = "移动到废纸篓"; -"delete" = "完全删除"; -"show in finder" = "定位文件"; -"refresh table" = "刷新列表"; -"import profile" = "导入profile"; -"export certificate file" = "导出证书文件"; -"expired" = "过期"; -"valid" = "有效"; +"Move to Trash" = "移动到废纸篓"; +"Delete" = "完全删除"; +"Show in Finder" = "定位文件"; +"Refresh Table" = "刷新列表"; +"Import Profile" = "导入Profile"; +"Export Certificate File" = "导出证书文件"; +"Expired" = "过期"; +"Valid" = "有效"; "Ok" = "确定"; -"Cancel" = "取消"; +"Cancle" = "取消"; "Confirm Delete Opration" = "确认删除操作"; "Delete this profie item permanently,can't rollback!" = "完全删除这个profie文件,不可回滚!"; "Warning" = "警告"; "are you sure move item to trash?" = "确定将此profie文件移动到废纸篓么?"; -"export" = "导出"; +"Export" = "导出"; +"Beautify Filename" = "美化文件名";