diff options
author | stuconnolly <stuart02@gmail.com> | 2012-04-07 21:49:20 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-04-07 21:49:20 +0000 |
commit | 535ae6f2b8313ea6d5ae2e878dcd17d369807079 (patch) | |
tree | a23077fce9643c2827312536722282f7cbe34c10 /Source | |
parent | ed7a963686d3682eeeb0232df4f3b62921db82c3 (diff) | |
download | sequelpro-535ae6f2b8313ea6d5ae2e878dcd17d369807079.tar.gz sequelpro-535ae6f2b8313ea6d5ae2e878dcd17d369807079.tar.bz2 sequelpro-535ae6f2b8313ea6d5ae2e878dcd17d369807079.zip |
Localize user manager dialogs.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPUserManager.m | 7 | ||||
-rw-r--r-- | Source/SPUserManagerDelegate.m | 16 |
2 files changed, 11 insertions, 12 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 35a97807..ac539624 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -365,8 +365,8 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; for (NSDictionary *rowDict in queryResults) { - NSManagedObject *dbPriv = [NSEntityDescription insertNewObjectForEntityForName:@"Privileges" - inManagedObjectContext:[self managedObjectContext]]; + NSManagedObject *dbPriv = [NSEntityDescription insertNewObjectForEntityForName:@"Privileges" inManagedObjectContext:[self managedObjectContext]]; + for (NSString *key in rowDict) { if ([key hasSuffix:@"_priv"]) { @@ -440,7 +440,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; if (coordinator != nil) { managedObjectContext = [[NSManagedObjectContext alloc] init]; - [managedObjectContext setPersistentStoreCoordinator: coordinator]; + [managedObjectContext setPersistentStoreCoordinator:coordinator]; } [[NSNotificationCenter defaultCenter] addObserver:self @@ -459,7 +459,6 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; */ - (IBAction)doCancel:(id)sender { - // Change the first responder to end editing in any field [[self window] makeFirstResponder:self]; diff --git a/Source/SPUserManagerDelegate.m b/Source/SPUserManagerDelegate.m index dccfe4c9..dc409308 100644 --- a/Source/SPUserManagerDelegate.m +++ b/Source/SPUserManagerDelegate.m @@ -151,11 +151,11 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; retVal = parent ? ([[parent children] count] > 0) : ([[selectedObject children] count] > 0); if (!retVal) { - NSAlert *alert = [NSAlert alertWithMessageText:@"User doesn't have any hosts." + NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"User has no hosts", @"user has no hosts message") defaultButton:NSLocalizedString(@"Add Host", @"Add Host") alternateButton:NSLocalizedString(@"Cancel", @"cancel button") otherButton:nil - informativeTextWithFormat:@"This user doesn't have any hosts associated with it. User will be deleted unless one is added"]; + informativeTextWithFormat:NSLocalizedString(@"This user doesn't have any hosts associated with it. It will be deleted unless one is added", @"user has no hosts informative message")]; if ([alert runModal] == NSAlertDefaultReturn) { [self addHost:nil]; @@ -276,14 +276,14 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; NSString *name = [selectedObject valueForKey:@"user"]; NSArray *results = [self _fetchUserWithUserName:name]; - if ([results count] > 1) - { - NSAlert *alert = [NSAlert alertWithMessageText:@"Duplicate User" + if ([results count] > 1) { + NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Duplicate User", @"duplicate user message") defaultButton:NSLocalizedString(@"OK", @"OK button") alternateButton:nil otherButton:nil - informativeTextWithFormat:@"A user with that name already exists"]; + informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"A user with the name '%@' already exists", @"duplicate user informative message"), name]]; [alert runModal]; + return NO; } } @@ -296,11 +296,11 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; { if (![selectedObject isEqual:child] && [[child valueForKey:@"host"] isEqualToString:host]) { - NSAlert *alert = [NSAlert alertWithMessageText:@"Duplicate Host" + NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Duplicate Host", @"duplicate host message") defaultButton:NSLocalizedString(@"OK", @"OK button") alternateButton:nil otherButton:nil - informativeTextWithFormat:@"A user with that host already exists"]; + informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"A user with the host '%@' already exists", @"duplicate host informative message"), host]]; [alert runModal]; |