Skip to content

Commit

Permalink
Fix codler#20, translate notification title
Browse files Browse the repository at this point in the history
  • Loading branch information
codler committed Sep 4, 2012
1 parent 466c834 commit bde735a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Battery Time Remaining/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ - (void)updateStatusItem
// Send notification once
if (self.previousPercent != self.currentPercent)
{
[self notify:[NSString stringWithFormat:NSLocalizedString(@"%ld:%02ld left (%ld%%)", @"Time remaining left notification"), hour, minute, self.currentPercent]];
[self notify:NSLocalizedString(@"Battery Time Remaining", "Battery Time Remaining notification") message:[NSString stringWithFormat:NSLocalizedString(@"%ld:%02ld left (%ld%%)", @"Time remaining left notification"), hour, minute, self.currentPercent]];
}
break;
}
Expand Down Expand Up @@ -517,9 +517,14 @@ - (void)toggleParenthesis:(id)sender
}

- (void)notify:(NSString *)message
{
[self notify:@"Battery Time Remaining" message:message];
}

- (void)notify:(NSString *)title message:(NSString *)message
{
NSUserNotification *notification = [[NSUserNotification alloc] init];
[notification setTitle:@"Battery Time Remaining"];
[notification setTitle:title];
[notification setInformativeText:message];
[notification setSoundName:NSUserNotificationDefaultSoundName];
NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter];
Expand Down

0 comments on commit bde735a

Please sign in to comment.