Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Cfg string table #65

Open
wants to merge 22 commits into
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+15 −6
Split
View
@@ -44,6 +44,13 @@ extern NSString *const kAppiraterRatedCurrentVersion;
extern NSString *const kAppiraterDeclinedToRate;
extern NSString *const kAppiraterReminderRequestDate;
+#define APPI_STRINGIZE(x) #x
+#define APPI_STRINGIZE2(x) APPI_STRINGIZE(x)
+
+#ifndef APPIRATER_STRINGS_TABLE
+#define APPIRATER_STRINGS_TABLE "AppiraterLocalizable"
+#endif
+
/*
Your localized app's name.
*/
@@ -58,30 +65,30 @@ extern NSString *const kAppiraterReminderRequestDate;
This is the message your users will see once they've passed the day+launches
threshold.
*/
-#define APPIRATER_LOCALIZED_MESSAGE NSLocalizedStringFromTable(@"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!", @"AppiraterLocalizable", nil)
+#define APPIRATER_LOCALIZED_MESSAGE NSLocalizedStringFromTable(@"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!", @APPI_STRINGIZE2(APPIRATER_STRINGS_TABLE), nil)
#define APPIRATER_MESSAGE [NSString stringWithFormat:APPIRATER_LOCALIZED_MESSAGE, APPIRATER_APP_NAME]
/*
This is the title of the message alert that users will see.
*/
-#define APPIRATER_LOCALIZED_MESSAGE_TITLE NSLocalizedStringFromTable(@"Rate %@", @"AppiraterLocalizable", nil)
+#define APPIRATER_LOCALIZED_MESSAGE_TITLE NSLocalizedStringFromTable(@"Rate %@", @APPI_STRINGIZE2(APPIRATER_STRINGS_TABLE), nil)
#define APPIRATER_MESSAGE_TITLE [NSString stringWithFormat:APPIRATER_LOCALIZED_MESSAGE_TITLE, APPIRATER_APP_NAME]
/*
The text of the button that rejects reviewing the app.
*/
-#define APPIRATER_CANCEL_BUTTON NSLocalizedStringFromTable(@"No, Thanks", @"AppiraterLocalizable", nil)
+#define APPIRATER_CANCEL_BUTTON NSLocalizedStringFromTable(@"No, Thanks", @APPI_STRINGIZE2(APPIRATER_STRINGS_TABLE), nil)
/*
Text of button that will send user to app review page.
*/
-#define APPIRATER_LOCALIZED_RATE_BUTTON NSLocalizedStringFromTable(@"Rate %@", @"AppiraterLocalizable", nil)
+#define APPIRATER_LOCALIZED_RATE_BUTTON NSLocalizedStringFromTable(@"Rate %@", @APPI_STRINGIZE2(APPIRATER_STRINGS_TABLE), nil)
#define APPIRATER_RATE_BUTTON [NSString stringWithFormat:APPIRATER_LOCALIZED_RATE_BUTTON, APPIRATER_APP_NAME]
/*
Text for button to remind the user to review later.
*/
-#define APPIRATER_RATE_LATER NSLocalizedStringFromTable(@"Remind me later", @"AppiraterLocalizable", nil)
+#define APPIRATER_RATE_LATER NSLocalizedStringFromTable(@"Remind me later", @APPI_STRINGIZE2(APPIRATER_STRINGS_TABLE), nil)
@interface Appirater : NSObject <UIAlertViewDelegate> {
View
@@ -122,7 +122,9 @@ - (BOOL)connectedToNetwork {
NSURLRequest *testRequest = [NSURLRequest requestWithURL:testURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0];
NSURLConnection *testConnection = [[NSURLConnection alloc] initWithRequest:testRequest delegate:self];
- return ((isReachable && !needsConnection) || nonWiFi) ? (testConnection ? YES : NO) : NO;
+ BOOL ret = ((isReachable && !needsConnection) || nonWiFi) ? (testConnection ? YES : NO) : NO;
+ [testConnection release];
+ return ret;
}
+ (Appirater*)sharedInstance {