One language setting; localized in-memory speech per language
This commit is contained in:
@@ -52,10 +52,11 @@ class Texts:
|
||||
self.subtitles(lang)
|
||||
return self._subs[lang][1].get(key, [])
|
||||
|
||||
def for_sound(self, sound):
|
||||
"""Subtitle lines of a speech sound in its own language (or the INT line for other languages)."""
|
||||
lang = sound.archive if sound.archive in self.subtitle_languages() else None
|
||||
if not lang:
|
||||
def for_sound(self, sound, lang=None):
|
||||
"""Subtitle lines of a speech sound, in `lang` (default: the sound's own language). Languages without
|
||||
their own voices link their subtitles to the INT sounds, so e.g. JPN subtitles are found for INT lines."""
|
||||
lang = lang or sound.language or sound.archive
|
||||
if lang not in self.subtitle_languages():
|
||||
return []
|
||||
return [s for s in self.subtitles(lang) if s.sound == sound.key]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user