diff --git a/Classes/SBQueue.m b/Classes/SBQueue.m index 020f681..3bc4163 100644 --- a/Classes/SBQueue.m +++ b/Classes/SBQueue.m @@ -249,7 +249,12 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification"; * sends SBQueueWorkingNotification. */ - (void)handleSBStatusWorking:(CGFloat)progress index:(NSInteger)index { - NSString *info = [NSString stringWithFormat:@"Processing file %ld of %lu.",(long)self.currentIndex + 1, (unsigned long)[self.items count]]; + NSString *description = self.currentItem.localizedWorkingDescription; + if (!description) { + description = NSLocalizedString(@"Working", @""); + } + NSString *info = [NSString stringWithFormat:@"%@, item %ld of %lu.", description, (long)self.currentIndex + 1, (unsigned long)self.items.count]; + [[NSNotificationCenter defaultCenter] postNotificationName:SBQueueWorkingNotification object:self userInfo:@{@"ProgressString": info, @"Progress": @(progress), @"ItemIndex": @(index)}]; diff --git a/Classes/SBQueueAction.h b/Classes/SBQueueAction.h index 34fc932..6b07961 100644 --- a/Classes/SBQueueAction.h +++ b/Classes/SBQueueAction.h @@ -17,6 +17,7 @@ */ @protocol SBQueueActionProtocol - (void)runAction:(SBQueueItem *)item; +@property (nonatomic, readonly) NSString *localizedDescription; @end /** diff --git a/Classes/SBQueueAction.m b/Classes/SBQueueAction.m index 4fe401a..fa4b624 100644 --- a/Classes/SBQueueAction.m +++ b/Classes/SBQueueAction.m @@ -62,7 +62,11 @@ } - (NSString *)description { - return @"Load Subtitles"; + return NSLocalizedString(@"Load Subtitles", @""); +} + +- (NSString *)localizedDescription { + return NSLocalizedString(@"Loading subtitles", @""); } - (instancetype)initWithCoder:(NSCoder *)coder { @@ -187,7 +191,11 @@ } - (NSString *)description { - return @"Search Metadata"; + return NSLocalizedString(@"Search Metadata", @""); +} + +- (NSString *)localizedDescription { + return NSLocalizedString(@"Searching metadata", @""); } - (instancetype)initWithCoder:(NSCoder *)coder { @@ -215,7 +223,11 @@ } - (NSString *)description { - return [NSString stringWithFormat:@"Apply %@ Set", _set.presetName]; + return [NSString stringWithFormat:NSLocalizedString(@"Apply %@ Set", @""), _set.presetName]; +} + +- (NSString *)localizedDescription { + return [NSString stringWithFormat:NSLocalizedString(@"Applying %@ set", @""), _set.presetName]; } - (instancetype)initWithCoder:(NSCoder *)coder { @@ -244,7 +256,11 @@ } - (NSString *)description { - return @"Organize Groups"; + return NSLocalizedString(@"Organize Groups", @""); +} + +- (NSString *)localizedDescription { + return NSLocalizedString(@"Organizing groups", @""); } - (instancetype)initWithCoder:(NSCoder *)coder { diff --git a/Classes/SBQueueItem.h b/Classes/SBQueueItem.h index 807f299..9416bf7 100755 --- a/Classes/SBQueueItem.h +++ b/Classes/SBQueueItem.h @@ -34,9 +34,11 @@ typedef enum SBQueueItemStatus : NSInteger { id _delegate; SBQueueItemStatus _status; + NSString *_localizedWorkingDescription; } @property (nonatomic, readwrite) SBQueueItemStatus status; +@property (nonatomic, readonly) NSString *localizedWorkingDescription; @property (nonatomic, readonly) MP42File *mp4File; diff --git a/Classes/SBQueueItem.m b/Classes/SBQueueItem.m index 0a0f0fc..39b8030 100755 --- a/Classes/SBQueueItem.m +++ b/Classes/SBQueueItem.m @@ -17,6 +17,8 @@ @interface SBQueueItem () +@property (nonatomic, readwrite) NSString *localizedWorkingDescription; + @property (nonatomic, readwrite, retain) MP42File *mp4File; @property (nonatomic, readwrite) NSMutableArray *actionsInternal; @property (atomic) BOOL cancelled; @@ -26,6 +28,7 @@ @implementation SBQueueItem @synthesize status = _status; +@synthesize localizedWorkingDescription = _localizedWorkingDescription; @synthesize attributes = _attributes; @synthesize actionsInternal = _actions; @@ -241,9 +244,13 @@ } for (id action in self.actions) { + self.localizedWorkingDescription = action.localizedDescription; + [self progressStatus:0]; [action runAction:self]; } + self.localizedWorkingDescription = nil; + return YES; } diff --git a/English.lproj/Queue.xib b/English.lproj/Queue.xib index 06f713c..a5c39b5 100755 --- a/English.lproj/Queue.xib +++ b/English.lproj/Queue.xib @@ -1,8 +1,8 @@ - + - + @@ -35,7 +35,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -171,7 +171,7 @@ - +