From 5f7331aa4dce389ea97481e1ebf707108381f13b Mon Sep 17 00:00:00 2001 From: michael starke Date: Tue, 21 Nov 2017 11:17:21 +0100 Subject: [PATCH] Updated localizations and comments --- MacPass.xcodeproj/project.pbxproj | 4 +-- MacPass/Base.lproj/InspectorView.xib | 4 +-- MacPass/MPAppDelegate.m | 2 +- MacPass/MPDatabaseSettingsWindowController.m | 29 ++++++++++------- MacPass/MPGroupInspectorViewController.m | 17 +++++----- MacPass/en.lproj/Localizable.strings | 34 ++++++++------------ 6 files changed, 44 insertions(+), 46 deletions(-) diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 7e860511..9ca25e59 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -488,7 +488,6 @@ 4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 02_MessageBoxWarningTemplate.pdf; sourceTree = ""; }; 4C5A11FB1708DE8700223D8A /* MPPasswordCreatorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordCreatorViewController.h; sourceTree = ""; }; 4C5A11FC1708DE8700223D8A /* MPPasswordCreatorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordCreatorViewController.m; sourceTree = ""; }; - 4C5ADC2E17830AFB004E1E8D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InspectorView.strings; sourceTree = ""; }; 4C5ADC3017830B09004E1E8D /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InspectorView.strings; sourceTree = ""; }; 4C5CD34017D158DE000B7F38 /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; lineEnding = 0; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.simpleColoring; }; 4C5CD34117D158DE000B7F38 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = fr; path = fr.lproj/Credits.rtf; sourceTree = ""; }; @@ -498,6 +497,7 @@ 4C5CD34617D15912000B7F38 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/MainMenu.strings; sourceTree = ""; }; 4C5CD34717D1591A000B7F38 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/PasswordInputView.strings; sourceTree = ""; }; 4C5CD34817D15920000B7F38 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InspectorView.strings; sourceTree = ""; }; + 4C5F72831FC4344E00929153 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InspectorView.strings; sourceTree = ""; }; 4C5FE9AC17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSelectedAttachmentTableCellView.h; sourceTree = ""; }; 4C5FE9AD17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSelectedAttachmentTableCellView.m; sourceTree = ""; }; 4C61EA0116D2FD0800AC519E /* MPOutlineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOutlineViewController.h; sourceTree = ""; }; @@ -2032,7 +2032,6 @@ isa = PBXVariantGroup; children = ( 4C7615701764C0E80015A1A6 /* Base */, - 4C5ADC2E17830AFB004E1E8D /* en */, 4C5ADC3017830B09004E1E8D /* de */, 4C5CD34817D15920000B7F38 /* fr */, 601F811418E016340028F3DE /* zh-Hans */, @@ -2041,6 +2040,7 @@ 4825CC8C1C414D58003E37E9 /* it */, 4C840C4F1D773E5E0081F605 /* pl */, 4C4161091F50333B003BC0AF /* es */, + 4C5F72831FC4344E00929153 /* en */, ); name = InspectorView.xib; sourceTree = ""; diff --git a/MacPass/Base.lproj/InspectorView.xib b/MacPass/Base.lproj/InspectorView.xib index f39cabbe..29e2835f 100644 --- a/MacPass/Base.lproj/InspectorView.xib +++ b/MacPass/Base.lproj/InspectorView.xib @@ -134,12 +134,12 @@ - + - + NSIsNotNil diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 5c0d6487..4248952f 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -314,7 +314,7 @@ NSString *const MPHelpURLKey = @"MPHelpURL"; if(error != nil){ NSAlert *alert = [[NSAlert alloc] init]; - [alert setMessageText: NSLocalizedString(@"FILE_OPEN_ERROR", nil)]; + [alert setMessageText: NSLocalizedString(@"FILE_OPEN_ERROR", "Error while reopening last known documents")]; [alert setInformativeText: [error localizedDescription]]; [alert setAlertStyle:NSCriticalAlertStyle ]; [alert runModal]; diff --git a/MacPass/MPDatabaseSettingsWindowController.m b/MacPass/MPDatabaseSettingsWindowController.m index 48a9bdba..6a66c9a3 100644 --- a/MacPass/MPDatabaseSettingsWindowController.m +++ b/MacPass/MPDatabaseSettingsWindowController.m @@ -244,18 +244,23 @@ self.databaseColorColorWell.color = tree.metaData.color ? tree.metaData.color : NSColor.clearColor; - //MPDocument *document = self.document; - KPKFileVersion version = tree.minimumVersion; - NSDictionary *nameMappings = @{ - @(KPKDatabaseFormatKdb): @"Kdb", - @(KPKDatabaseFormatKdbx): @"Kdbx", - @(KPKDatabaseFormatUnknown): NSLocalizedString(@"UNKNOWN_FORMAT", "Unknown databas format.") - }; - - NSUInteger mayor = (version.version >> 16); - NSUInteger minor = (version.version & 0xFFFF); - - self.fileVersionTextField.stringValue = [NSString stringWithFormat:@"%@ (Version %ld.%ld)", nameMappings[@(version.format)], mayor, minor]; + NSData *fileData = [NSData dataWithContentsOfURL:((MPDocument *)self.document).fileURL]; + if(!fileData) { + self.fileVersionTextField.stringValue = NSLocalizedString(@"UNKNOWN_FORMAT_FILE_NOT_SAVED_YET", "Database format is unknown since the file is not saved yet"); + } + else { + KPKFileVersion version = [[KPKFormat sharedFormat] fileVersionForData:fileData]; + NSDictionary *nameMappings = @{ + @(KPKDatabaseFormatKdb): @"Kdb", + @(KPKDatabaseFormatKdbx): @"Kdbx", + @(KPKDatabaseFormatUnknown): NSLocalizedString(@"UNKNOWN_FORMAT", "Unknown databas format.") + }; + + NSUInteger mayor = (version.version >> 16); + NSUInteger minor = (version.version & 0xFFFF); + + self.fileVersionTextField.stringValue = [NSString stringWithFormat:@"%@ (Version %ld.%ld)", nameMappings[@(version.format)], mayor, minor]; + } } - (void)_setupSecurityTab:(KPKMetaData *)metaData { diff --git a/MacPass/MPGroupInspectorViewController.m b/MacPass/MPGroupInspectorViewController.m index 2382fb5b..8c3a67ff 100644 --- a/MacPass/MPGroupInspectorViewController.m +++ b/MacPass/MPGroupInspectorViewController.m @@ -75,11 +75,11 @@ [self.view layoutSubtreeIfNeeded]; NSMenu *autotypeMenu = self.autotypePopupButton.menu; - NSMenuItem *inheritAutotype = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"AUTOTYPE_INHERIT", "") action:NULL keyEquivalent:@""]; + NSMenuItem *inheritAutotype = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"AUTOTYPE_INHERIT", "Inherit autotype settings menu item") action:NULL keyEquivalent:@""]; inheritAutotype.tag = KPKInherit; - NSMenuItem *enableAutotype = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"AUTOTYPE_YES", "") action:NULL keyEquivalent:@""]; + NSMenuItem *enableAutotype = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"AUTOTYPE_YES", "Enable autotype menu item") action:NULL keyEquivalent:@""]; enableAutotype.tag = KPKInheritYES; - NSMenuItem *disableAutotype = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"AUTOTYPE_NO", "") action:NULL keyEquivalent:@""]; + NSMenuItem *disableAutotype = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"AUTOTYPE_NO", "Disable autotype menu item") action:NULL keyEquivalent:@""]; disableAutotype.tag = KPKInheritNO; [autotypeMenu addItem:inheritAutotype]; @@ -87,11 +87,11 @@ [autotypeMenu addItem:disableAutotype]; NSMenu *searchMenu = self.searchPopupButton.menu; - NSMenuItem *inheritSearch = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SEARCH_INHERIT", "") action:NULL keyEquivalent:@""]; + NSMenuItem *inheritSearch = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SEARCH_INHERIT", "Inherit search settings menu item") action:NULL keyEquivalent:@""]; inheritSearch.tag = KPKInherit; - NSMenuItem *includeInSearch = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SEARCH_YES", "") action:NULL keyEquivalent:@""]; + NSMenuItem *includeInSearch = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SEARCH_YES", "Enable search menu item") action:NULL keyEquivalent:@""]; includeInSearch.tag = KPKInheritYES; - NSMenuItem *excludeFromSearch = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SEARCH_NO", "") action:NULL keyEquivalent:@""]; + NSMenuItem *excludeFromSearch = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SEARCH_NO", "Disable search menu item") action:NULL keyEquivalent:@""]; excludeFromSearch.tag = KPKInheritNO; [searchMenu addItem:inheritSearch]; @@ -102,10 +102,11 @@ } - (void)_establishBindings { + NSDictionary *nullPlaceholderOptionsDict = @ {NSNullPlaceholderBindingOption: NSLocalizedString(@"NONE", @"Null placeholder for item input field") }; [self.titleTextField bind:NSValueBinding toObject:self withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(title))] - options:@{NSNullPlaceholderBindingOption: NSLocalizedString(@"NONE", @"")}]; + options:nullPlaceholderOptionsDict]; [self.expiresCheckButton bind:NSValueBinding toObject:self withKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(expires))] @@ -121,7 +122,7 @@ [self.autotypeSequenceTextField bind:NSValueBinding toObject:self withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(defaultAutoTypeSequence))] - options:@{NSNullPlaceholderBindingOption: NSLocalizedString(@"NONE", @"")}]; + options:nullPlaceholderOptionsDict]; [self.searchPopupButton bind:NSSelectedTagBinding toObject:self withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(isSearchEnabled))] diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings index 9565dfe9..0766ae57 100644 --- a/MacPass/en.lproj/Localizable.strings +++ b/MacPass/en.lproj/Localizable.strings @@ -25,20 +25,12 @@ /* Action to add an entry via template */ "ADD_TREMPLATE_ENTRY" = "Create Template Entry"; -/* Alert informative text when a plugin was sucessfully installed */ -"ALERT_INFORMATIVE_TEXT_PLUGIN_INSTALLED_SUGGEST_RESTART" = "Plugins can only be loaded at start up. To activate the installed plugin, please restart MacPass."; - -/* Alert informative text when a plugin was sucessfully uninstalled */ -"ALERT_INFORMATIVE_TEXT_PLUGIN_UNINSTALLED_SUGGEST_RESTART" = "Plugins cannot be removed while MacPass is running. Please restart MacPass to unload the plugin."; - /* Alert informative text to ask the user if he really want to uninstall the plugin */ "ALERT_INFORMATIVE_TEXT_REALLY_UNINSTALL_PLUGIN" = "The Plugin will be moved to the Trash."; -/* Alert message text when a plugin was successfully uninstalled. Include %@ placeholder for plugin name */ -"ALERT_MESSAGE_TEXT_PLUGIN_%@_UNINSTALLED_SUGGEST_RESTART" = "Plugin %@ uninstalled!"; - -/* Alert message text when a plugin was successfully installed */ -"ALERT_MESSAGE_TEXT_PLUGIN_INSTALLED_SUGGEST_RESTART" = "Sucessfully installed Plugin!"; +/* Alert informative text when plugins or their settings change and require a restart + Alert message text when plugins or their settings change and require a restart */ +"ALERT_MESSAGE_PLUGINS_CHANGED_SUGGEST_RESTART" = "Changes to plugins take only effect after restart."; /* Alert message text to ask the user if he really want to uninstall the plugin. Include %@ placeholder for plugin name */ "ALERT_MESSAGE_TEXT_REALLY_UNINSTALL_PLUGIN_%@" = "Should the Plugin %@ really be uninstalled?"; @@ -78,7 +70,7 @@ "CHANGE_DATABASE_NAME" = "Change Database Name"; /* (No Comment) */ -"CHANGE_FORMAT" = "Change File Format to KDBX"; +"CHANGE_FORMAT" = "Change File Format to Kdbx"; /* Button to postpone the password change */ "CHANGE_LATER" = "Change Later"; @@ -198,12 +190,6 @@ /* Menu item to duplicate an entry with options how to duplicate. Will present a dialog. */ "DUPLICATE_ENTRY_WITH_OPTIONS" = "Duplicate Entry…"; -/* (No Comment) */ -"DUPLICTE_PASSWORDS" = "Duplicate Passwords"; - -/* (No Comment) */ -"EDIT" = "Edit"; - /* Menu item in the database outline context menu to change the template group Menu item on the add entry context menu to edit template groups */ "EDIT_TEMPLATE_GROUP" = "Edit Entry Template Group"; @@ -542,7 +528,13 @@ "UNINSTALL" = "Uninstall"; /* No comment provided by engineer. */ -"UNKNOWN_FILE_VERSION" = "Unknown File Version"; +"UNKNOWN_FILE_VERSION" = "Unknown file version"; + +/* Unknown databas format. */ +"UNKNOWN_FORMAT" = "Unknown file format"; + +/* Database format is unknown since the file is not saved yet */ +"UNKNOWN_FORMAT_FILE_NOT_SAVED_YET" = "Unknown, file not saved yet"; /* No comment provided by engineer. */ "UNKNOWN_TOOLBAR_ITEM" = "Unknown Toolbar Item"; @@ -584,10 +576,10 @@ "WARNING_ON_EMPTY_TRASH_TITLE" = "Empty Trash?"; /* (No Comment) */ -"WARNING_ON_LOSSY_SAVE" = "Saving with KDB format, will lead to lost data."; +"WARNING_ON_LOSSY_SAVE" = "Saving with Kdb format, will lead to lost data."; /* (No Comment) */ -"WARNING_ON_LOSSY_SAVE_DESCRIPTION" = "The KDB file format cannot hold all information."; +"WARNING_ON_LOSSY_SAVE_DESCRIPTION" = "The Kdb file format cannot hold all information."; /* No comment provided by engineer. */ "WARNING_ON_SAVE_NO_PASSWORD_OR_KEY_SET" = "No password or keyfile is set.";