Skip to content

Commit

Permalink
Make the string table used configurable via a pre-processor define.
Browse files Browse the repository at this point in the history
  • Loading branch information
jum committed Sep 18, 2012
1 parent 43db20c commit 76f4a04
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Appirater.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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> {
Expand Down

0 comments on commit 76f4a04

Please sign in to comment.