From f78185270c0716d96836e2a4da86519367329293 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Thu, 18 Feb 2016 13:26:19 +0100 Subject: [PATCH] Added some localize strings. --- .../PropertyView/English.lproj/MovieView.xib | 50 +++---------------- .../PropertyView/English.lproj/SoundView.xib | 4 ++ .../PropertyView/English.lproj/VideoView.xib | 4 ++ Classes/PropertyView/SBMovieViewController.m | 18 +++---- Classes/PropertyView/SBVideoViewController.m | 2 + Classes/SBAppDelegate.m | 6 +-- Classes/SBDocument.m | 4 +- Classes/SBFileImport.m | 12 ++--- Classes/SBMediaTagsController.m | 20 ++++---- Classes/SBMetadataSearchController.m | 6 +-- Classes/SBOptionsViewController.m | 2 +- Classes/SBQueue.m | 2 +- Classes/SBQueueAction.m | 16 +++--- Classes/SBQueueController.m | 8 +-- English.lproj/SBMediaTagsController.xib | 10 ++-- MP42Foundation | 2 +- Subler.xcodeproj/project.pbxproj | 2 + 17 files changed, 73 insertions(+), 95 deletions(-) diff --git a/Classes/PropertyView/English.lproj/MovieView.xib b/Classes/PropertyView/English.lproj/MovieView.xib index 5d5383f..1e4ad84 100755 --- a/Classes/PropertyView/English.lproj/MovieView.xib +++ b/Classes/PropertyView/English.lproj/MovieView.xib @@ -1,9 +1,9 @@ - + - - + + @@ -35,7 +35,6 @@ - @@ -50,9 +49,8 @@ - + - @@ -338,30 +336,24 @@ - - - - @@ -380,7 +372,6 @@ - + diff --git a/Classes/PropertyView/English.lproj/SoundView.xib b/Classes/PropertyView/English.lproj/SoundView.xib index 797fd9d..8cc9c74 100755 --- a/Classes/PropertyView/English.lproj/SoundView.xib +++ b/Classes/PropertyView/English.lproj/SoundView.xib @@ -181,9 +181,13 @@ + + + + diff --git a/Classes/PropertyView/English.lproj/VideoView.xib b/Classes/PropertyView/English.lproj/VideoView.xib index 28125ea..da93e4f 100755 --- a/Classes/PropertyView/English.lproj/VideoView.xib +++ b/Classes/PropertyView/English.lproj/VideoView.xib @@ -416,9 +416,13 @@ + + + + diff --git a/Classes/PropertyView/SBMovieViewController.m b/Classes/PropertyView/SBMovieViewController.m index 750ec9d..295ed6d 100755 --- a/Classes/PropertyView/SBMovieViewController.m +++ b/Classes/PropertyView/SBMovieViewController.m @@ -132,7 +132,7 @@ NSString *MetadataPBoardType = @"SublerMetadataPBoardType"; [[undo prepareWithInvocationTarget:self] remove:data]; if (![undo isUndoing]) { - [undo setActionName:@"Insert"]; + [undo setActionName:NSLocalizedString(@"Insert", @"Undo tag insert.")]; } [self updateTagsArray]; @@ -151,7 +151,7 @@ NSString *MetadataPBoardType = @"SublerMetadataPBoardType"; [[undo prepareWithInvocationTarget:self] add:data]; if (![undo isUndoing]) { - [undo setActionName:@"Delete"]; + [undo setActionName:NSLocalizedString(@"Delete", @"Undo tag delete")]; } [self updateTagsArray]; @@ -194,7 +194,7 @@ NSString *MetadataPBoardType = @"SublerMetadataPBoardType"; [[undo prepareWithInvocationTarget:self] updateMetadata:oldValue forKey:key]; if (![undo isUndoing]) { - [undo setActionName:@"Editing"]; + [undo setActionName:NSLocalizedString(@"Editing", @"Undo tag editing.")]; } } [oldValue release]; @@ -286,23 +286,23 @@ NSString *MetadataPBoardType = @"SublerMetadataPBoardType"; [setListMenu removeItemAtIndex: 1]; } - NSMenuItem *newItem = [[[NSMenuItem alloc] initWithTitle:@"Save Set" action:@selector(showSaveSet:) keyEquivalent:@""] autorelease]; + NSMenuItem *newItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Save Set", @"Set menu") action:@selector(showSaveSet:) keyEquivalent:@""] autorelease]; [newItem setTarget:self]; [setListMenu addItem:newItem]; [setListMenu addItem:[NSMenuItem separatorItem]]; - newItem = [[[NSMenuItem alloc] initWithTitle:@"All" action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; + newItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"All", @"Set menu All set") action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; [newItem setTarget:self]; [newItem setTag: 0]; [setListMenu addItem:newItem]; - newItem = [[[NSMenuItem alloc] initWithTitle:@"Movie" action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; + newItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Movie", @"Set menu Movie set") action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; [newItem setTarget:self]; [newItem setTag: 1]; [setListMenu addItem:newItem]; - newItem = [[[NSMenuItem alloc] initWithTitle:@"TV Show" action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; + newItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"TV Show", @"Set menu TV Show Set") action:@selector(addMetadataSet:) keyEquivalent:@""] autorelease]; [newItem setTarget:self]; [newItem setTag: 2]; [setListMenu addItem:newItem]; @@ -598,7 +598,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn [[undo prepareWithInvocationTarget:self] changeGapless: self]; if (![undo isUndoing]) { - [undo setActionName:@"Check Gapless"]; + [undo setActionName:NSLocalizedString(@"Check Gapless", @"Undo check gapless")]; } } @@ -621,7 +621,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn [[undo prepareWithInvocationTarget:self] changePodcast: self]; if (![undo isUndoing]) { - [undo setActionName:@"Check Podast"]; + [undo setActionName:NSLocalizedString(@"Check Podast", @"Undo check podcast")]; } } diff --git a/Classes/PropertyView/SBVideoViewController.m b/Classes/PropertyView/SBVideoViewController.m index 907d637..815531f 100755 --- a/Classes/PropertyView/SBVideoViewController.m +++ b/Classes/PropertyView/SBVideoViewController.m @@ -328,6 +328,8 @@ static NSString *getLevelName(uint8_t level) { [_forced release]; + [_mediaTagsController release]; + [super dealloc]; } diff --git a/Classes/SBAppDelegate.m b/Classes/SBAppDelegate.m index 6abbec5..c102768 100644 --- a/Classes/SBAppDelegate.m +++ b/Classes/SBAppDelegate.m @@ -75,9 +75,9 @@ NSInteger result; if (status == SBQueueStatusWorking) { result = NSRunCriticalAlertPanel( - NSLocalizedString(@"Are you sure you want to quit Subler?", nil), - NSLocalizedString(@"Your current queue will be lost. Do you want to quit anyway?", nil), - NSLocalizedString(@"Quit", nil), NSLocalizedString(@"Don't Quit", nil), nil); + NSLocalizedString(@"Are you sure you want to quit Subler?", @"Quit alert title."), + NSLocalizedString(@"Your current queue will be lost. Do you want to quit anyway?", @"Quit alert description."), + NSLocalizedString(@"Quit", @"Quit alert default action."), NSLocalizedString(@"Don't Quit", @"Quict alert cancel action."), nil); if (result == NSAlertDefaultReturn) { return NSTerminateNow; diff --git a/Classes/SBDocument.m b/Classes/SBDocument.m index 657436c..549d83a 100755 --- a/Classes/SBDocument.m +++ b/Classes/SBDocument.m @@ -176,7 +176,7 @@ dispatch_sync(dispatch_get_main_queue(), ^{ [optBar setIndeterminate:YES]; [optBar startAnimation:self]; - [saveOperationName setStringValue:@"Saving…"]; + [saveOperationName setStringValue:NSLocalizedString(@"Saving…", @"Document Saving sheet.")]; [NSApp beginSheet:savingWindow modalForWindow:documentWindow modalDelegate:nil didEndSelector:NULL contextInfo:nil]; }); @@ -219,7 +219,7 @@ if (result && _optimize) { dispatch_async(dispatch_get_main_queue(), ^{ - [saveOperationName setStringValue:@"Optimizing…"]; + [saveOperationName setStringValue:NSLocalizedString(@"Optimizing…", @"Document Optimize sheet.")]; }); result = [self.mp4 optimize]; _optimize = NO; diff --git a/Classes/SBFileImport.m b/Classes/SBFileImport.m index fe3c9fa..e1aa623 100755 --- a/Classes/SBFileImport.m +++ b/Classes/SBFileImport.m @@ -212,7 +212,7 @@ } } else { - NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Passthru", @"File Import action menu item.") action:NULL keyEquivalent:@""] autorelease]; [item setTag:0]; [item setEnabled:YES]; [[actionCell menu] addItem:item]; @@ -227,7 +227,7 @@ } else if ([track isMemberOfClass:[MP42SubtitleTrack class]]) { NSInteger tag = 0; - NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Passthru", @"File Import action menu item.") action:NULL keyEquivalent:@""] autorelease]; [item setTag:tag++]; if (!trackNeedConversion(track.format)) { [item setEnabled:YES]; @@ -246,14 +246,14 @@ } } else if ([track isMemberOfClass:[MP42ClosedCaptionTrack class]]) { - NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Passthru", @"File Import action menu item.") action:NULL keyEquivalent:@""] autorelease]; [item setTag:0]; [item setEnabled:YES]; [[actionCell menu] addItem:item]; } else if ([track isMemberOfClass:[MP42AudioTrack class]]) { NSInteger tag = 0; - NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Passthru", @"File Import action menu item.") action:NULL keyEquivalent:@""] autorelease]; [item setTag:tag++]; if (!trackNeedConversion(track.format)) [item setEnabled:YES]; @@ -273,7 +273,7 @@ [track.format isEqualTo:MP42AudioFormatEAC3] || [track.format isEqualTo:MP42AudioFormatDTS]) { - item = [[[NSMenuItem alloc] initWithTitle:@"AAC + Passthru" action:NULL keyEquivalent:@""] autorelease]; + item = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"AAC + Passthru", @"File Import action menu item.") action:NULL keyEquivalent:@""] autorelease]; [item setTag:tag++]; [item setEnabled:YES]; [[actionCell menu] addItem:item]; @@ -281,7 +281,7 @@ } else if ([track isMemberOfClass:[MP42ChapterTrack class]]) { - NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:@"Passthru" action:NULL keyEquivalent:@""] autorelease]; + NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Passthru", @"File Import action menu item.") action:NULL keyEquivalent:@""] autorelease]; [item setTag:0]; [item setEnabled:YES]; [[actionCell menu] addItem:item]; diff --git a/Classes/SBMediaTagsController.m b/Classes/SBMediaTagsController.m index 44ae69e..10bd96d 100644 --- a/Classes/SBMediaTagsController.m +++ b/Classes/SBMediaTagsController.m @@ -110,16 +110,16 @@ NS_ASSUME_NONNULL_END } + (nullable NSString *)localizedTitleForTag:(NSString *)tag { - NSDictionary *localizedDescriptions = @{@"public.main-program-content": NSLocalizedString(@"Main Program Content", nil), - @"public.auxiliary-content": NSLocalizedString(@"Auxiliary Content", nil), - @"public.subtitles.forced-only": NSLocalizedString(@"Contains Only Forced Subtitles", nil), - @"public.accessibility.transcribes-spoken-dialog": NSLocalizedString(@"Transcribes Spoken Dialog For Accessibility", nil), - @"public.accessibility.describes-music-and-sound": NSLocalizedString(@"Describes Music And Sound For Accessibility", nil), - @"public.easy-to-read": NSLocalizedString(@"Easy To Read", nil), - @"public.accessibility.describes-video": NSLocalizedString(@"Describes Video For Accessibility", nil), - @"public.translation.dubbed": NSLocalizedString(@"Dubbed Translation", nil), - @"public.translation.voice-over": NSLocalizedString(@"Voice Over Translation", nil), - @"public.translation": NSLocalizedString(@"Language Translation", nil) }; + NSDictionary *localizedDescriptions = @{@"public.main-program-content": NSLocalizedString(@"Main Program Content", @"Media characteristic."), + @"public.auxiliary-content": NSLocalizedString(@"Auxiliary Content", @"Media characteristic."), + @"public.subtitles.forced-only": NSLocalizedString(@"Contains Only Forced Subtitles", @"Media characteristic."), + @"public.accessibility.transcribes-spoken-dialog": NSLocalizedString(@"Transcribes Spoken Dialog For Accessibility", @"Media characteristic."), + @"public.accessibility.describes-music-and-sound": NSLocalizedString(@"Describes Music And Sound For Accessibility", @"Media characteristic."), + @"public.easy-to-read": NSLocalizedString(@"Easy To Read", @"Media characteristic."), + @"public.accessibility.describes-video": NSLocalizedString(@"Describes Video For Accessibility", @"Media characteristic."), + @"public.translation.dubbed": NSLocalizedString(@"Dubbed Translation", @"Media characteristic."), + @"public.translation.voice-over": NSLocalizedString(@"Voice Over Translation", @"Media characteristic."), + @"public.translation": NSLocalizedString(@"Language Translation", @"Media characteristic.") }; return localizedDescriptions[tag]; } diff --git a/Classes/SBMetadataSearchController.m b/Classes/SBMetadataSearchController.m index e9ced58..c27ff2b 100755 --- a/Classes/SBMetadataSearchController.m +++ b/Classes/SBMetadataSearchController.m @@ -301,10 +301,10 @@ [addButton setEnabled:NO]; if (self.selectedResult.mediaKind == 9) { - [self startProgressReportWithString:@"Downloading additional movie metadata…"]; + [self startProgressReportWithString:NSLocalizedString(@"Downloading additional movie metadata…", nil)]; self.currentSearcher = [SBMetadataImporter importerForProvider:[[movieMetadataProvider selectedItem] title]]; } else if (self.selectedResult.mediaKind == 10) { - [self startProgressReportWithString:@"Downloading additional TV metadata…"]; + [self startProgressReportWithString:NSLocalizedString(@"Downloading additional TV metadata…", nil)]; self.currentSearcher = [SBMetadataImporter importerForProvider:[[tvMetadataProvider selectedItem] title]]; } @@ -348,7 +348,7 @@ if (indexes.count) { [progress startAnimation:self]; [progress setHidden:NO]; - [progressText setStringValue:@"Downloading artwork…"]; + [progressText setStringValue:NSLocalizedString(@"Downloading artwork…", nil)]; [progressText setHidden:NO]; [tvSeriesName setEnabled:NO]; [tvSeasonNum setEnabled:NO]; diff --git a/Classes/SBOptionsViewController.m b/Classes/SBOptionsViewController.m index e20dbcc..442beb2 100644 --- a/Classes/SBOptionsViewController.m +++ b/Classes/SBOptionsViewController.m @@ -182,7 +182,7 @@ static void *SBOptionsViewContex = &SBOptionsViewContex; panel.canChooseDirectories = YES; panel.canCreateDirectories = YES; - [panel setPrompt:@"Select"]; + [panel setPrompt:NSLocalizedString(@"Select", @"Select queue destination.")]; [panel beginWithCompletionHandler:^(NSInteger result) { if (result == NSFileHandlingPanelOKButton) { NSMenuItem *folderItem = [self prepareDestPopupItem:[panel URL]]; diff --git a/Classes/SBQueue.m b/Classes/SBQueue.m index 3f91e8f..fc2f851 100644 --- a/Classes/SBQueue.m +++ b/Classes/SBQueue.m @@ -254,7 +254,7 @@ NSString *SBQueueCancelledNotification = @"SBQueueCancelledNotification"; - (void)handleSBStatusWorking:(CGFloat)progress index:(NSInteger)index { NSString *description = self.currentItem.localizedWorkingDescription; if (!description) { - description = NSLocalizedString(@"Working", @""); + description = NSLocalizedString(@"Working", @"Queue Working."); } NSString *info = [NSString stringWithFormat:@"%@, item %ld of %lu.", description, (long)self.currentIndex + 1, (unsigned long)self.items.count]; diff --git a/Classes/SBQueueAction.m b/Classes/SBQueueAction.m index 2a5510b..9219bb6 100644 --- a/Classes/SBQueueAction.m +++ b/Classes/SBQueueAction.m @@ -65,11 +65,11 @@ } - (NSString *)description { - return NSLocalizedString(@"Load Subtitles", @""); + return NSLocalizedString(@"Load Subtitles", @"Action description."); } - (NSString *)localizedDescription { - return NSLocalizedString(@"Loading subtitles", @""); + return NSLocalizedString(@"Loading subtitles", @"Action localized description."); } - (instancetype)initWithCoder:(NSCoder *)coder { @@ -206,11 +206,11 @@ } - (NSString *)description { - return NSLocalizedString(@"Search Metadata", @""); + return NSLocalizedString(@"Search Metadata", @"Action description."); } - (NSString *)localizedDescription { - return NSLocalizedString(@"Searching metadata", @""); + return NSLocalizedString(@"Searching metadata", @"Action localized description."); } - (instancetype)initWithCoder:(NSCoder *)coder { @@ -281,11 +281,11 @@ } - (NSString *)description { - return NSLocalizedString(@"Organize Groups", @""); + return NSLocalizedString(@"Organize Groups", @"Organize Groups action description"); } - (NSString *)localizedDescription { - return NSLocalizedString(@"Organizing groups", @""); + return NSLocalizedString(@"Organizing groups", @"Organize Groups action local description"); } - (instancetype)initWithCoder:(NSCoder *)coder { @@ -308,11 +308,11 @@ } - (NSString *)description { - return NSLocalizedString(@"Fixing Fallbacks", @""); + return NSLocalizedString(@"Fixing Fallbacks", @"Action description."); } - (NSString *)localizedDescription { - return NSLocalizedString(@"Fixing Fallbacks", @""); + return NSLocalizedString(@"Fixing Fallbacks", @"Action localized description."); } - (instancetype)initWithCoder:(NSCoder *)coder { diff --git a/Classes/SBQueueController.m b/Classes/SBQueueController.m index bfd1add..07013e4 100755 --- a/Classes/SBQueueController.m +++ b/Classes/SBQueueController.m @@ -114,7 +114,7 @@ static void *SBQueueContex = &SBQueueContex; [_progressIndicator setDoubleValue:0]; [_progressIndicator setIndeterminate:YES]; [_startItem setImage:[NSImage imageNamed:@"playBackTemplate"]]; - [_countLabel setStringValue:@"Done"]; + [_countLabel setStringValue:NSLocalizedString(@"Done", @"Queue -> Done")]; [self updateUI]; }]; @@ -325,7 +325,7 @@ static void *SBQueueContex = &SBQueueContex; [[undo prepareWithInvocationTarget:self] removeItems:items]; if (![undo isUndoing]) { - [undo setActionName:@"Add Queue Item"]; + [undo setActionName:NSLocalizedString(@"Add Queue Item", @"Queue -> redo add item.")]; } if ([undo isUndoing] || [undo isRedoing]) [self updateUI]; @@ -352,7 +352,7 @@ static void *SBQueueContex = &SBQueueContex; [[undo prepareWithInvocationTarget:self] addItems:items atIndexes:indexes]; if (![undo isUndoing]) { - [undo setActionName:@"Delete Queue Item"]; + [undo setActionName:NSLocalizedString(@"Delete Queue Item", @"Queue -> Undo delete item.")]; } if ([undo isUndoing] || [undo isRedoing]) [self updateUI]; @@ -485,7 +485,7 @@ static void *SBQueueContex = &SBQueueContex; return; [_startItem setImage:[NSImage imageNamed:@"stopTemplate"]]; - [_countLabel setStringValue:@"Working."]; + [_countLabel setStringValue:NSLocalizedString(@"Working.", @"Queue -> Working")]; [_progressIndicator setHidden:NO]; [_progressIndicator startAnimation:self]; diff --git a/English.lproj/SBMediaTagsController.xib b/English.lproj/SBMediaTagsController.xib index 73a7feb..3ccbfb9 100644 --- a/English.lproj/SBMediaTagsController.xib +++ b/English.lproj/SBMediaTagsController.xib @@ -26,20 +26,20 @@ - + - + - + - + @@ -53,7 +53,7 @@ - +