aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-04-19 22:25:36 +0000
committerrowanbeentje <rowan@beent.je>2012-04-19 22:25:36 +0000
commit7bf2d269c3311b640ce67e0a4860965e079fef97 (patch)
treeed4505edf55c920bae47f3b6b4ead2acb04df933
parent3be7eafd0a5c8c2e75aec41bc1d5b1323c69e6b7 (diff)
downloadsequelpro-7bf2d269c3311b640ce67e0a4860965e079fef97.tar.gz
sequelpro-7bf2d269c3311b640ce67e0a4860965e079fef97.tar.bz2
sequelpro-7bf2d269c3311b640ce67e0a4860965e079fef97.zip
- Fix localisation of export tokens, preventing duplication of strings to be translated causing translation faults; this addresses Issue #1322.
-rw-r--r--Resources/English.lproj/Localizable.stringsbin230192 -> 229994 bytes
-rwxr-xr-xResources/German.lproj/Localizable.stringsbin240056 -> 240054 bytes
-rw-r--r--Source/SPExportFilenameUtilities.m28
3 files changed, 17 insertions, 11 deletions
diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings
index 6643741c..bb958cf7 100644
--- a/Resources/English.lproj/Localizable.strings
+++ b/Resources/English.lproj/Localizable.strings
Binary files differ
diff --git a/Resources/German.lproj/Localizable.strings b/Resources/German.lproj/Localizable.strings
index 6bdc81ff..fb319f88 100755
--- a/Resources/German.lproj/Localizable.strings
+++ b/Resources/German.lproj/Localizable.strings
Binary files differ
diff --git a/Source/SPExportFilenameUtilities.m b/Source/SPExportFilenameUtilities.m
index ad5ab36b..1f37a561 100644
--- a/Source/SPExportFilenameUtilities.m
+++ b/Source/SPExportFilenameUtilities.m
@@ -65,32 +65,38 @@
BOOL isCSV = exportType == SPCSVExport;
BOOL isDot = exportType == SPDotExport;
BOOL isXML = exportType == SPXMLExport;
-
- NSString *tokens = NSLocalizedString(@"host,database,table,date,year,month,day,time", @"default custom export filename tokens");;
- NSString *tokensWithoutTable = NSLocalizedString(@"host,database,date,year,month,day,time", @"custom export filename tokens without table");
-
+
+ NSMutableArray *exportTokens = [NSMutableArray arrayWithObjects:
+ NSLocalizedString(@"host", @"export filename host token"),
+ NSLocalizedString(@"database", @"export filename database token"),
+ NSLocalizedString(@"table", @"table"),
+ NSLocalizedString(@"date", @"export filename date token"),
+ NSLocalizedString(@"year", @"export filename date token"),
+ NSLocalizedString(@"month", @"export filename date token"),
+ NSLocalizedString(@"day", @"export filename date token"),
+ NSLocalizedString(@"time", @"export filename time token"),
+ nil];
+
+ // Determine whether to remove the table from the tokens list
if (exportSource == SPQueryExport || isDot) {
- tokens = tokensWithoutTable;
+ removeTable = YES;
}
else if (isSQL || isCSV || isXML) {
for (NSArray *table in tables)
{
if ([NSArrayObjectAtIndex(table, 2) boolValue]) {
i++;
- removeTable = YES;
-
if (i == 2) break;
}
}
if (i > 1) {
removeTable = isSQL ? YES : ![exportFilePerTableCheck state];
-
- tokens = isSQL ? tokensWithoutTable : ([exportFilePerTableCheck state] ? tokens : tokensWithoutTable);
}
}
if (removeTable) {
+ [exportTokens removeObject:NSLocalizedString(@"table", @"table")];
NSArray *tokenParts = [exportCustomFilenameTokenField objectValue];
for (id token in [exportCustomFilenameTokenField objectValue])
@@ -107,8 +113,8 @@
}
}
}
-
- [exportCustomFilenameTokensField setStringValue:tokens];
+
+ [exportCustomFilenameTokensField setStringValue:[exportTokens componentsJoinedByString:@","]];
}
/**