aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-07-18 00:12:58 +0000
committerrowanbeentje <rowan@beent.je>2010-07-18 00:12:58 +0000
commitad7cf0d9a34f5392193b55aab9121153391578d4 (patch)
tree0c669d0ae9aefa2b0097b9779eda9aacce905e1c /Source
parent8a5c8b954e00302cf5de32edcaf12c0b7b3eed82 (diff)
downloadsequelpro-ad7cf0d9a34f5392193b55aab9121153391578d4.tar.gz
sequelpro-ad7cf0d9a34f5392193b55aab9121153391578d4.tar.bz2
sequelpro-ad7cf0d9a34f5392193b55aab9121153391578d4.zip
- Expose a number of help menu items and help buttons to use localisable strings
- Tweak MySQL help search to include a localisable language code for results in requested languages This addresses Issue #743
Diffstat (limited to 'Source')
-rw-r--r--Source/SPAppController.m12
-rw-r--r--Source/SPConnectionController.m2
-rw-r--r--Source/SPConstants.h16
-rw-r--r--Source/SPConstants.m9
-rw-r--r--Source/SPCustomQuery.m3
-rw-r--r--Source/SPDotExporter.m2
-rw-r--r--Source/SPExportInitializer.m2
-rw-r--r--Source/SPQueryFavoriteManager.m2
-rw-r--r--Source/SPSQLExporter.m2
-rw-r--r--Source/SPTextView.m2
10 files changed, 23 insertions, 29 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index 840f78f8..4bd8edeb 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -649,7 +649,7 @@
*/
- (IBAction)visitWebsite:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPHomePageURL]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPLOCALIZEDURL_HOMEPAGE]];
}
/**
@@ -657,7 +657,7 @@
*/
- (IBAction)visitHelpWebsite:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPDocumentationURL]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPLOCALIZEDURL_DOCUMENTATION]];
}
/**
@@ -665,7 +665,7 @@
*/
- (IBAction)visitFAQWebsite:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPFAQURL]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPLOCALIZEDURL_FAQ]];
}
/**
@@ -673,7 +673,7 @@
*/
- (IBAction)provideFeedback:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPContactURL]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPLOCALIZEDURL_CONTACT]];
}
/**
@@ -681,7 +681,7 @@
*/
- (IBAction)provideTranslationFeedback:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPTranslationFeedbackURL]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPLOCALIZEDURL_TRANSLATIONFEEDBACK]];
}
/**
@@ -689,7 +689,7 @@
*/
- (IBAction)viewKeyboardShortcuts:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPKeyboardShortcutsURL]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPLOCALIZEDURL_KEYBOARDSHORTCUTS]];
}
#pragma mark -
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index fb293c4b..bd239e6c 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -479,7 +479,7 @@
*/
- (IBAction)showHelp:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPGettingConnectedDocURL]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:SPLOCALIZEDURL_CONNECTIONHELP]];
}
#pragma mark -
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index a7a10fc2..3f69b268 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -175,6 +175,15 @@ typedef enum
SPEncodingEUCKRKorean = 180
} SPEncodingTypes;
+// Predefined localisable URLs
+#define SPLOCALIZEDURL_HOMEPAGE NSLocalizedString(@"http://www.sequelpro.com/", @"Localized home page - do not localize if no translated webpage is available")
+#define SPLOCALIZEDURL_FAQ NSLocalizedString(@"http://www.sequelpro.com/docs/Frequently_Asked_Questions", @"Localized help page for Frequently Asked Questions - do not localize if no translated webpage is available")
+#define SPLOCALIZEDURL_DOCUMENTATION NSLocalizedString(@"http://www.sequelpro.com/docs/", @"Localized documentation home page - do not localize if no translated webpage is available")
+#define SPLOCALIZEDURL_CONTACT NSLocalizedString(@"http://www.sequelpro.com/docs/Contact_the_developers", @"Localized contact page - do not localize if no translated webpage is available")
+#define SPLOCALIZEDURL_KEYBOARDSHORTCUTS NSLocalizedString(@"http://www.sequelpro.com/docs/Keyboard_Shortcuts", @"Localized keyboard shortcuts page - do not localize if no translated webpage is available")
+#define SPLOCALIZEDURL_CONNECTIONHELP NSLocalizedString(@"http://www.sequelpro.com/docs/Getting_Connected", @"Localized connection help page - do not localize if no translated webpage is available")
+#define SPLOCALIZEDURL_TRANSLATIONFEEDBACK NSLocalizedString(@"http://dev.sequelpro.com/translate/feedback", @"Localized translation feedback page - do not localize if no translated webpage is available")
+
// Long running notification time for Growl messages
extern const CGFloat SPLongRunningNotificationTime;
@@ -321,16 +330,9 @@ extern NSString *SPBlobTextEditorSpellCheckingEnabled;
extern NSString *SPUniqueSchemaDelimiter;
// URLs
-extern NSString *SPHomePageURL;
extern NSString *SPDonationsURL;
-extern NSString *SPFAQURL;
-extern NSString *SPDocumentationURL;
-extern NSString *SPContactURL;
-extern NSString *SPKeyboardShortcutsURL;
extern NSString *SPMySQLSearchURL;
extern NSString *SPDevURL;
-extern NSString *SPGettingConnectedDocURL;
-extern NSString *SPTranslationFeedbackURL;
// Toolbar constants
diff --git a/Source/SPConstants.m b/Source/SPConstants.m
index bd02875f..36a9a25b 100644
--- a/Source/SPConstants.m
+++ b/Source/SPConstants.m
@@ -169,16 +169,9 @@ NSString *SPBlobTextEditorSpellCheckingEnabled = @"BlobTextEditorSpellChecking
NSString *SPUniqueSchemaDelimiter = @"￸"; // U+FFF8
// URLs
-NSString *SPHomePageURL = @"http://www.sequelpro.com/";
NSString *SPDonationsURL = @"http://www.sequelpro.com/donate.html";
-NSString *SPFAQURL = @"http://www.sequelpro.com/docs/Frequently_Asked_Questions";
-NSString *SPDocumentationURL = @"http://www.sequelpro.com/docs/";
-NSString *SPContactURL = @"http://www.sequelpro.com/docs/Contact_the_developers";
-NSString *SPKeyboardShortcutsURL = @"http://www.sequelpro.com/docs/Keyboard_Shortcuts";
-NSString *SPMySQLSearchURL = @"http://search.mysql.com/search?q=%@&site=refman-%@";
+NSString *SPMySQLSearchURL = @"http://search.mysql.com/search?q=%@&site=refman-%@&lr=lang_%@";
NSString *SPDevURL = @"http://code.google.com/p/sequel-pro/";
-NSString *SPGettingConnectedDocURL = @"http://www.sequelpro.com/docs/Getting_Connected";
-NSString *SPTranslationFeedbackURL = @"http://dev.sequelpro.com/translate/feedback";
// Toolbar constants
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 02cd25ff..520370d2 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -2561,7 +2561,8 @@
[[NSString stringWithFormat:
SPMySQLSearchURL,
searchString,
- version]
+ version,
+ NSLocalizedString(@"en", @"MySQL search language code - eg in http://search.mysql.com/search?q=select&site=refman-50&lr=lang_en")]
stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]];
}
diff --git a/Source/SPDotExporter.m b/Source/SPDotExporter.m
index 9296b231..88b859db 100644
--- a/Source/SPDotExporter.m
+++ b/Source/SPDotExporter.m
@@ -80,7 +80,7 @@
[metaString setString:@"// ************************************************************\n"];
[metaString appendString:@"// Generated by: Sequel Pro\n"];
[metaString appendString:[NSString stringWithFormat:@"// Version %@\n//\n", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]];
- [metaString appendString:[NSString stringWithFormat:@"// %@\n// %@\n//\n", SPHomePageURL, SPDevURL]];
+ [metaString appendString:[NSString stringWithFormat:@"// %@\n// %@\n//\n", SPLOCALIZEDURL_HOMEPAGE, SPDevURL]];
[metaString appendString:[NSString stringWithFormat:@"// Host: %@ (MySQL %@)\n", [self dotDatabaseHost], [self dotDatabaseVersion]]];
[metaString appendString:[NSString stringWithFormat:@"// Database: %@\n", [self dotDatabaseName]]];
[metaString appendString:[NSString stringWithFormat:@"// Generation Time: %@\n", [NSDate date]]];
diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m
index b674db09..2478b1b3 100644
--- a/Source/SPExportInitializer.m
+++ b/Source/SPExportInitializer.m
@@ -553,7 +553,7 @@
[header appendString:@"<!--\n-\n"];
[header appendString:@"- Sequel Pro XML dump\n"];
[header appendString:[NSString stringWithFormat:@"- Version %@\n-\n", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]];
- [header appendString:[NSString stringWithFormat:@"- %@\n- %@\n-\n", SPHomePageURL, SPDevURL]];
+ [header appendString:[NSString stringWithFormat:@"- %@\n- %@\n-\n", SPLOCALIZEDURL_HOMEPAGE, SPDevURL]];
[header appendString:[NSString stringWithFormat:@"- Host: %@ (MySQL %@)\n", [tableDocumentInstance host], [tableDocumentInstance mySQLVersion]]];
[header appendString:[NSString stringWithFormat:@"- Database: %@\n", [tableDocumentInstance database]]];
[header appendString:[NSString stringWithFormat:@"- Generation Time: %@\n", [NSDate date]]];
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 875be7ca..bab73f55 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -394,7 +394,7 @@
- (IBAction)showHelp:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.sequelpro.com/docs/Query_Favorites"]];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:NSLocalizedString(@"http://www.sequelpro.com/docs/Query_Favorites", @"Localized help page for query favourites - do not localize if no translated webpage is available")]];
}
#pragma mark -
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m
index 683e3a48..3d36fce3 100644
--- a/Source/SPSQLExporter.m
+++ b/Source/SPSQLExporter.m
@@ -174,7 +174,7 @@
// Add the dump header to the dump file
[metaString appendString:@"# Sequel Pro SQL dump\n"];
[metaString appendString:[NSString stringWithFormat:@"# Version %@\n#\n", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]];
- [metaString appendString:[NSString stringWithFormat:@"# %@\n# %@\n#\n", SPHomePageURL, SPDevURL]];
+ [metaString appendString:[NSString stringWithFormat:@"# %@\n# %@\n#\n", SPLOCALIZEDURL_HOMEPAGE, SPDevURL]];
[metaString appendString:[NSString stringWithFormat:@"# Host: %@ (MySQL %@)\n", [self sqlDatabaseHost], [self sqlDatabaseVersion]]];
[metaString appendString:[NSString stringWithFormat:@"# Database: %@\n", [self sqlDatabaseName]]];
[metaString appendString:[NSString stringWithFormat:@"# Generation Time: %@\n", [NSDate date]]];
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index cef42e87..4b906ed0 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -73,8 +73,6 @@ YY_BUFFER_STATE yy_scan_string (const char *);
#define SP_SYNTAX_HILITE_BIAS 2000
#define SP_MAX_TEXT_SIZE_FOR_SYNTAX_HIGHLIGHTING 20000000
-#define MYSQL_DOC_SEARCH_URL @"http://dev.mysql.com/doc/refman/%@/en/%@.html"
-
#pragma mark -
// some helper functions for handling rectangles and points