You’d play the YT videos outside the browser using mpv in combination with yt-dlp and an mpv lua script would do the translation locally using the Bergamot engine (which happens to be Mozilla’s translation engine). Could be adapted to use other engines too.
Any naming convention is fine as long as it’s meaningful to you. But it’s a good idea to keep your own repos separate from the random ones you clone from the internet.
So, this is a more involved approach and it’s not a Firefox add-on but I thought I’d mention it:
https://fnordig.de/til/Machine-Translation/bergamot-subtitles.html
You’d play the YT videos outside the browser using mpv in combination with yt-dlp and an mpv lua script would do the translation locally using the Bergamot engine (which happens to be Mozilla’s translation engine). Could be adapted to use other engines too.