Skip to content

Commit a0532db

Browse files
committed
Fix #20, translate notification title
1 parent cd8e05c commit a0532db

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Battery Time Remaining/AppDelegate.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ - (void)updateStatusItem
276276
// Send notification once
277277
if (self.previousPercent != self.currentPercent)
278278
{
279-
[self notify:[NSString stringWithFormat:NSLocalizedString(@"%ld:%02ld left (%ld%%)", @"Time remaining left notification"), hour, minute, self.currentPercent]];
279+
[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]];
280280
}
281281
break;
282282
}
@@ -517,9 +517,14 @@ - (void)toggleParenthesis:(id)sender
517517
}
518518

519519
- (void)notify:(NSString *)message
520+
{
521+
[self notify:@"Battery Time Remaining" message:message];
522+
}
523+
524+
- (void)notify:(NSString *)title message:(NSString *)message
520525
{
521526
NSUserNotification *notification = [[NSUserNotification alloc] init];
522-
[notification setTitle:@"Battery Time Remaining"];
527+
[notification setTitle:title];
523528
[notification setInformativeText:message];
524529
[notification setSoundName:NSUserNotificationDefaultSoundName];
525530
NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter];

0 commit comments

Comments
 (0)