diff options
author | ritsuka <[email protected]> | 2014-07-31 11:59:14 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-07-31 11:59:14 +0000 |
commit | 0bab714e71a9cce63197a4f61596190db00debd0 (patch) | |
tree | 7e95b2daca5473c8414e51c65a3ef417d66d38a4 | |
parent | 0e0c317a9327eb166089a9d68c435e698cfe2cd4 (diff) |
MacGui: use the native language if available in the subtitles table and languages selection table.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6249 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/HBLanguagesSelection.m | 4 | ||||
-rw-r--r-- | macosx/HBSubtitlesController.m | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/macosx/HBLanguagesSelection.m b/macosx/HBLanguagesSelection.m index 8a27ad9c1..0ffe3e52a 100644 --- a/macosx/HBLanguagesSelection.m +++ b/macosx/HBLanguagesSelection.m @@ -41,7 +41,9 @@ const iso639_lang_t *lang = lang_get_next(NULL); for (lang = lang_get_next(lang); lang != NULL; lang = lang_get_next(lang)) { - HBLang *item = [[[HBLang alloc] initWithLanguage:@(lang->eng_name) + NSString *nativeLanguage = strlen(lang->native_name) ? @(lang->native_name) : @(lang->eng_name); + + HBLang *item = [[[HBLang alloc] initWithLanguage:nativeLanguage iso639_2code:@(lang->iso639_2)] autorelease]; if ([languages containsObject:item.iso639_2]) { diff --git a/macosx/HBSubtitlesController.m b/macosx/HBSubtitlesController.m index a804de748..f5c3c4792 100644 --- a/macosx/HBSubtitlesController.m +++ b/macosx/HBSubtitlesController.m @@ -124,11 +124,15 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex"; [forcedSourceNamesArray addObject:subSourceName]; } + // Use the native language name if available + iso639_lang_t *language = lang_for_code2(subtitle->iso639_2); + NSString *nativeLanguage = strlen(language->native_name) ? @(language->native_name) : @(language->eng_name); + /* create a dictionary of source subtitle information to store in our array */ - [self.subtitleSourceArray addObject:@{keySubTrackName: [NSString stringWithFormat:@"%d: %@ (%@) (%@)", i, @(subtitle->lang), bitmapOrText, subSourceName], + [self.subtitleSourceArray addObject:@{keySubTrackName: [NSString stringWithFormat:@"%d: %@ (%@) (%@)", i, nativeLanguage, bitmapOrText, subSourceName], keySubTrackIndex: @(i), keySubTrackType: @(subtitle->source), - keySubTrackLanguage: @(subtitle->lang), + keySubTrackLanguage: nativeLanguage, keySubTrackLanguageIsoCode: @(subtitle->iso639_2)}]; } |