aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-07-02 20:28:57 +0000
committerstuconnolly <stuart02@gmail.com>2010-07-02 20:28:57 +0000
commit8af000934e13e1ed0f9bb73c26bfdc8b156d6525 (patch)
tree076aaef6ccb68a21815d3a54cd2a60c6a457eb9c
parent94511f3cec3b02dfb05b9aef1cb8fb0eece2924e (diff)
downloadsequelpro-8af000934e13e1ed0f9bb73c26bfdc8b156d6525.tar.gz
sequelpro-8af000934e13e1ed0f9bb73c26bfdc8b156d6525.tar.bz2
sequelpro-8af000934e13e1ed0f9bb73c26bfdc8b156d6525.zip
Localise the custom export filename tokens.
-rw-r--r--Resources/English.lproj/Localizable.stringsbin156626 -> 157282 bytes
-rw-r--r--Source/SPExportController.m28
2 files changed, 13 insertions, 15 deletions
diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings
index dbb058ab..75c9a851 100644
--- a/Resources/English.lproj/Localizable.strings
+++ b/Resources/English.lproj/Localizable.strings
Binary files differ
diff --git a/Source/SPExportController.m b/Source/SPExportController.m
index 6f072e84..aac8592b 100644
--- a/Source/SPExportController.m
+++ b/Source/SPExportController.m
@@ -95,7 +95,7 @@
prefs = [NSUserDefaults standardUserDefaults];
// Default filename tokens
- availableFilenameTokens = @"host,database,table,date,time";
+ availableFilenameTokens = NSLocalizedString(@"host,database,table,date,time", @"default custom export filename tokens");
}
return self;
@@ -231,33 +231,31 @@
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
[dateFormatter setTimeStyle:NSDateFormatterNoStyle];
- [string replaceOccurrencesOfString:@"host" withString:[tableDocumentInstance host]
+ [string replaceOccurrencesOfString:NSLocalizedString(@"host", @"export filename host token")
+ withString:[tableDocumentInstance host]
options:NSLiteralSearch
range:NSMakeRange(0, [string length])];
- [string replaceOccurrencesOfString:@"database" withString:[tableDocumentInstance database]
+ [string replaceOccurrencesOfString:NSLocalizedString(@"database", @"export filename database token")
+ withString:[tableDocumentInstance database]
options:NSLiteralSearch
range:NSMakeRange(0, [string length])];
- if (table) {
- [string replaceOccurrencesOfString:@"table" withString:table
- options:NSLiteralSearch
- range:NSMakeRange(0, [string length])];
- }
- else {
- [string replaceOccurrencesOfString:@"table" withString:@""
- options:NSLiteralSearch
- range:NSMakeRange(0, [string length])];
- }
+ [string replaceOccurrencesOfString:NSLocalizedString(@"table", @"table")
+ withString:(table) ? table : @""
+ options:NSLiteralSearch
+ range:NSMakeRange(0, [string length])];
- [string replaceOccurrencesOfString:@"date" withString:[dateFormatter stringFromDate:[NSDate date]]
+ [string replaceOccurrencesOfString:NSLocalizedString(@"date", @"export filename date token")
+ withString:[dateFormatter stringFromDate:[NSDate date]]
options:NSLiteralSearch
range:NSMakeRange(0, [string length])];
[dateFormatter setDateStyle:NSDateFormatterNoStyle];
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];
- [string replaceOccurrencesOfString:@"time" withString:[dateFormatter stringFromDate:[NSDate date]]
+ [string replaceOccurrencesOfString:NSLocalizedString(@"time", @"export filename time token")
+ withString:[dateFormatter stringFromDate:[NSDate date]]
options:NSLiteralSearch
range:NSMakeRange(0, [string length])];