0.1.12 • Published 9 months ago

@mpv-easy/translate v0.1.12

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

install

You need to install ffmpeg and curl and add them to PATH, curl is usually installed by default on all systems including windows11, if you only use interactive translation, you don't need to install ffmpeg

  • Download the latest version of mpv-translate.js and copy it to the mpv script directory, or use mpsm mpsm install mpv-translate
  • Add shortcut keys ctrl+t script-message translate and ctrl+i script-message interactive-translate to your input.conf
  • If everything goes well, you can use ctrl+t to start global translation (requires ffmpeg and curl and only supports local videos), ctrl+i to start interactive translation (requires curl)
  • You can customize the styles of subtitles and tooltips, see mpv-translate.conf

support language

https://cloud.google.com/translate/docs/languages

config

{
  "sourceLang": "en-US",
  "targetLang": "zh-CN",
}

translate (ctrl+t)

Default subtitle is English

Translate to Chinese

mix-translate (ctrl+shif+t or ctrl+T)

Display Chinese and English

interactive-translate (ctrl+i)

Click left mouse button to play the audio, and click the wheel to display the full sentence translation

mix-translate and interactive-translate (ctrl+T then ctrl+i)

Mix translation and interactive translation can be used at the same time

todo

  • auto detect source language
  • remove ffmpeg dependency
  • support more languages
  • support ass
  • support bing, deepl