From 76f4a049a091fe133ac33771184f75efeabf4074 Mon Sep 17 00:00:00 2001 From: Jens-Uwe Mager Date: Tue, 18 Sep 2012 13:16:18 -0700 Subject: [PATCH] Make the string table used configurable via a pre-processor define. --- Appirater.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Appirater.h b/Appirater.h index 0e52162c..2340fe81 100644 --- a/Appirater.h +++ b/Appirater.h @@ -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 {