diff --git a/resources/language/resource.language.en_au/strings.po b/resources/language/resource.language.en_au/strings.po index b5f2756eb..a89e3ba7c 100644 --- a/resources/language/resource.language.en_au/strings.po +++ b/resources/language/resource.language.en_au/strings.po @@ -1400,3 +1400,7 @@ msgstr "" msgctxt "#30774" msgid "All available" msgstr "" + +msgctxt "#30775" +msgid "%s (translation)" +msgstr "" diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 0a5dd59c0..a538dddd8 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1400,3 +1400,7 @@ msgstr "" msgctxt "#30774" msgid "All available" msgstr "" + +msgctxt "#30775" +msgid "%s (translation)" +msgstr "" diff --git a/resources/language/resource.language.en_nz/strings.po b/resources/language/resource.language.en_nz/strings.po index a52043a25..f819f45ce 100644 --- a/resources/language/resource.language.en_nz/strings.po +++ b/resources/language/resource.language.en_nz/strings.po @@ -1396,3 +1396,7 @@ msgstr "" msgctxt "#30774" msgid "All available" msgstr "" + +msgctxt "#30775" +msgid "%s (translation)" +msgstr "" diff --git a/resources/language/resource.language.en_us/strings.po b/resources/language/resource.language.en_us/strings.po index 13a859a6b..0f89e12ae 100644 --- a/resources/language/resource.language.en_us/strings.po +++ b/resources/language/resource.language.en_us/strings.po @@ -1401,3 +1401,7 @@ msgstr "" msgctxt "#30774" msgid "All available" msgstr "" + +msgctxt "#30775" +msgid "%s (translation)" +msgstr "" diff --git a/resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py b/resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py index 5e5858ee1..0e1a1f177 100644 --- a/resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py +++ b/resources/lib/youtube_plugin/kodion/context/xbmc/xbmc_context.py @@ -194,6 +194,7 @@ class XbmcContext(AbstractContext): 'subtitles.all': 30774, 'subtitles.language': 30560, 'subtitles.no_auto_generated': 30602, + 'subtitles.translation': 30775, 'subtitles.with_fallback': 30601, 'succeeded': 30575, 'trending': 30513, diff --git a/resources/lib/youtube_plugin/youtube/helper/subtitles.py b/resources/lib/youtube_plugin/youtube/helper/subtitles.py index 485c3f5a0..4c643eba4 100644 --- a/resources/lib/youtube_plugin/youtube/helper/subtitles.py +++ b/resources/lib/youtube_plugin/youtube/helper/subtitles.py @@ -231,26 +231,26 @@ def _prompt(self): if not num_total: self._context.log_debug('No subtitles found for prompt') else: + translation_lang = self._context.localize('subtitles.translation') choice = self._context.get_ui().on_select( self._context.localize('subtitles.language'), [name for _, name in captions] + - [name + ' *' for _, name in translations] + [translation_lang % name for _, name in translations] ) - if choice == -1: - self._context.log_debug('Subtitle selection cancelled') - return None - track = None if 0 <= choice < num_captions: track = self.caption_tracks[choice] kind = track.get('kind') - choice = translations[choice - num_captions] + choice = captions[choice - num_captions] is_translation = False elif num_captions <= choice < num_total: track = self.defaults['translation_base'] kind = 'translation' choice = translations[choice - num_captions] is_translation = True + else: + self._context.log_debug('Subtitle selection cancelled') + return None url = self._get_url( caption_track=track, diff --git a/resources/lib/youtube_plugin/youtube/helper/video_info.py b/resources/lib/youtube_plugin/youtube/helper/video_info.py index e86f03606..cfc0b0208 100644 --- a/resources/lib/youtube_plugin/youtube/helper/video_info.py +++ b/resources/lib/youtube_plugin/youtube/helper/video_info.py @@ -1858,12 +1858,13 @@ def _filter_group(previous_group, previous_stream, item): set_id += 1 if subs_data: + translation_lang = self._context.localize('subtitles.translation') for lang_code, subtitle in subs_data.items(): label = language = subtitle['language'] kind = subtitle['kind'] if kind: if kind == 'translation': - label = '{0} ({1})'.format(language, kind) + label = translation_lang % language kind = '_'.join((lang_code, kind)) else: kind = lang_code