Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

French localization changes and new class method resetToDefaults #48

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Appirater.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,11 @@ extern NSString *const kAppiraterReminderRequestDate;
*/
+ (void)rateApp;

/*
Tells Appirater to reset all counters for tracking.
This is generally used only for debugging when you want to test different
thresholds of rating trigger thresholds
*/
+ (void)resetToDefaults;

@end
21 changes: 14 additions & 7 deletions Appirater.m
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,7 @@ - (void)incrementSignificantEventCount {
else
{
// it's a new version of the app, so restart tracking
[userDefaults setObject:version forKey:kAppiraterCurrentVersion];
[userDefaults setDouble:0 forKey:kAppiraterFirstUseDate];
[userDefaults setInteger:0 forKey:kAppiraterUseCount];
[userDefaults setInteger:1 forKey:kAppiraterSignificantEventCount];
[userDefaults setBool:NO forKey:kAppiraterRatedCurrentVersion];
[userDefaults setBool:NO forKey:kAppiraterDeclinedToRate];
[userDefaults setDouble:0 forKey:kAppiraterReminderRequestDate];
[[self class] resetToDefaults];
}

[userDefaults synchronize];
Expand Down Expand Up @@ -332,6 +326,19 @@ + (void)rateApp {
#endif
}

+ (void)resetToDefaults {
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:version forKey:kAppiraterCurrentVersion];
[userDefaults setDouble:0 forKey:kAppiraterFirstUseDate];
[userDefaults setInteger:0 forKey:kAppiraterUseCount];
[userDefaults setInteger:1 forKey:kAppiraterSignificantEventCount];
[userDefaults setBool:NO forKey:kAppiraterRatedCurrentVersion];
[userDefaults setBool:NO forKey:kAppiraterDeclinedToRate];
[userDefaults setDouble:0 forKey:kAppiraterReminderRequestDate];
[userDefaults synchronize];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];

Expand Down
4 changes: 2 additions & 2 deletions fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"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!" = "Si vous aimez %@, voulez-vous prendre un moment pour l'évaluer? Il ne prendra pas plus d'une minute. Merci pour votre soutien!";
"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!" = "Si vous aimez %@, voulez-vous prendre un moment pour l'évaluer? Cela ne prendra pas plus d'une minute. Merci pour votre soutien!";
"Rate %@" = "Notez %@";
"No, Thanks" = "Non, Merci";
"No, Thanks" = "Non merci";
"Remind me later" = "Rappelez-moi plus tard";