From 937786724187f7301b429673b77579912cae62c9 Mon Sep 17 00:00:00 2001 From: dmoagx Date: Fri, 26 Aug 2011 22:48:20 +0000 Subject: * Fixes some strings that were not really localizable the way they were constructed. --- Resources/English.lproj/ExportDialog.strings | Bin 24626 -> 24888 bytes Resources/English.lproj/Localizable.strings | Bin 221400 -> 223016 bytes Source/SPTableContent.m | 32 ++++++++++++++++++--------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Resources/English.lproj/ExportDialog.strings b/Resources/English.lproj/ExportDialog.strings index 15ad4cda..f807e881 100644 Binary files a/Resources/English.lproj/ExportDialog.strings and b/Resources/English.lproj/ExportDialog.strings differ diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings index 775c3b64..64310f40 100644 Binary files a/Resources/English.lproj/Localizable.strings and b/Resources/English.lproj/Localizable.strings differ diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 533b28c3..ba774615 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -2170,26 +2170,36 @@ [[SPQueryController sharedQueryController] setAllowConsoleUpdate:consoleUpdateStatus]; if (errors) { - NSArray *message; + NSMutableString *messageText = [NSMutableString stringWithCapacity:50]; + NSString *messageTitle = NSLocalizedString(@"Unexpected number of rows removed!", @"Table Content : Remove Row : Result : n Error title"); if (errors < 0) { - message = [NSArray arrayWithObjects:NSLocalizedString(@"Warning", @"warning"), - [NSString stringWithFormat:NSLocalizedString(@"%ld row%@ more %@ deleted! Please check the Console and inform the Sequel Pro team!", @"message of panel when more rows were deleted"), (long)(errors *- 1), ((errors *-1 ) > 1) ? @"s" : @"", (errors>1) ? @"were" : @"was"], - nil]; + long numErrors = (long)(errors *- 1); + if(numErrors == 1) + [messageText appendString:NSLocalizedString(@"One additional row was removed!",@"Table Content : Remove Row : Result : Too Many : Part 1 : n+1 rows instead of n selected were deleted.")]; + else + [messageText appendFormat:NSLocalizedString(@"%ld additional rows were removed!",@"Table Content : Remove Row : Result : Too Many : Part 1 : n+y (y!=1) rows instead of n selected were deleted."),numErrors]; + + [messageText appendString:NSLocalizedString(@" Please check the Console and inform the Sequel Pro team!",@"Table Content : Remove Row : Result : Too Many : Part 2 : Generic text")]; + } else { + //part 1 number of rows not deleted + if(errors == 1) + [messageText appendString:NSLocalizedString(@"One row was not removed.",@"Table Content : Remove Row : Result : Too Few : Part 1 : Only n-1 of n selected rows were deleted.")]; + else + [messageText appendFormat:NSLocalizedString(@"%ld rows were not removed.",@"Table Content : Remove Row : Result : Too Few : Part 1 : n-x (x!=1) of n selected rows were deleted."),errors]; + //part 2 generic help text + [messageText appendString:NSLocalizedString(@" Reload the table to be sure that the contents have not changed in the meantime.",@"Table Content : Remove Row : Result : Too Few : Part 2 : Generic help message")]; + //part 3 primary keys if (primaryKeyFieldNames == nil) - message = [NSArray arrayWithObjects:NSLocalizedString(@"Warning", @"warning"), - [NSString stringWithFormat:NSLocalizedString(@"%ld row%@ ha%@ not been deleted. Reload the table to be sure that the rows exist and use a primary key for your table.", @"message of panel when not all selected fields have been deleted"), (long)errors, (errors > 1) ? @"s" : @"", (errors > 1) ? @"ve" : @"s"], - nil]; + [messageText appendString:NSLocalizedString(@" You should also add a primary key to this table!",@"Table Content : Remove Row : Result : Too Few : Part 3 : no primary key in table generic message")]; else - message = [NSArray arrayWithObjects:NSLocalizedString(@"Warning", @"warning"), - [NSString stringWithFormat:NSLocalizedString(@"%ld row%@ ha%@ not been deleted. Reload the table to be sure that the rows exist and check the Console for possible errors inside the primary key%@ for your table.", @"message of panel when not all selected fields have been deleted by using primary keys"), (long)errors, (errors > 1) ? @"s" : @"", (errors > 1) ? @"ve" : @"s", (errors > 1) ? @"s" : @""], - nil]; + [messageText appendString:NSLocalizedString(@" Check the Console for possible errors inside the primary key(s) of this table!",@"Table Content : Remove Row : Result : Too Few : Part 3 : Row not deleted when using primary key for DELETE statement.")]; } [self performSelector:@selector(showErrorSheetWith:) - withObject:message + withObject:[NSArray arrayWithObjects:messageTitle,messageText,nil] afterDelay:0.3]; } -- cgit v1.2.3