[Translations] Load PlaylistEntry error messages

These error messages should be loaded from the main bundle, where the
class is located.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-18 16:16:43 -07:00
parent ecb30dd734
commit 41d4c7458e
3 changed files with 4 additions and 4 deletions

View File

@ -189,7 +189,7 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
if(!pe.url) { if(!pe.url) {
pe.error = YES; pe.error = YES;
pe.errorMessage = NSLocalizedString(@"ErrorMessageBadFile", @""); pe.errorMessage = NSLocalizedStringFromTableInBundle(@"ErrorMessageBadFile", nil, [NSBundle bundleForClass:[self class]], @"");
[[FIRCrashlytics crashlytics] log:@"Attempting to play bad file."]; [[FIRCrashlytics crashlytics] log:@"Attempting to play bad file."];
return; return;
} }
@ -591,7 +591,7 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
[[FIRCrashlytics crashlytics] log:@"Invalid playlist entry reached."]; [[FIRCrashlytics crashlytics] log:@"Invalid playlist entry reached."];
[player setNextStream:nil]; [player setNextStream:nil];
pe.error = YES; pe.error = YES;
pe.errorMessage = NSLocalizedString(@"ErrorMessageBadFile", @""); pe.errorMessage = NSLocalizedStringFromTableInBundle(@"ErrorMessageBadFile", nil, [NSBundle bundleForClass:[self class]], @"");
} else { } else {
[[FIRCrashlytics crashlytics] log:@"End of playlist reached."]; [[FIRCrashlytics crashlytics] log:@"End of playlist reached."];
[player setNextStream:nil]; [player setNextStream:nil];

View File

@ -484,7 +484,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
- (void)setMetadata:(NSDictionary *)metadata { - (void)setMetadata:(NSDictionary *)metadata {
if(metadata == nil) { if(metadata == nil) {
self.error = YES; self.error = YES;
self.errorMessage = NSLocalizedString(@"ErrorMetadata", @""); self.errorMessage = NSLocalizedStringFromTableInBundle(@"ErrorMetadata", nil, [NSBundle bundleForClass:[self class]], @"");
} else { } else {
self.volume = 1; self.volume = 1;
[self setValuesForKeysWithDictionary:metadata]; [self setValuesForKeysWithDictionary:metadata];

View File

@ -646,7 +646,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
[weakLock lock]; [weakLock lock];
if(!weakPe.url) { if(!weakPe.url) {
weakPe.error = YES; weakPe.error = YES;
weakPe.errorMessage = NSLocalizedString(@"ErrorMessageBadFile", @""); weakPe.errorMessage = NSLocalizedStringFromTableInBundle(@"ErrorMessageBadFile", nil, [NSBundle bundleForClass:[self class]], @"");
} }
progress += progressstep; progress += progressstep;
[self setProgressJobStatus:progress]; [self setProgressJobStatus:progress];