This is an experimental Kodi addon intending to provide automatic translation of subtitles using various online translation services.
The addon basically re-packs the python package translatepy for Kodi and adds a little to:
- perform automatic translation
- offer subtitles text to the translation service in such a way to ensure optimal translation result.
- optionally suppress colourisation of subtitles intended for the hearing impaired.
- optionally suppress sound descriptions in subtitles intended for the hearing impaired.
- optionally suppress lyrics of songs in subtitles intended for the hearing impaired.
- Extend the time subtitles are shown on screen.
Check the addon’s settings to enable automatic translation and to set various other options.
The latest version of the addon can only perform automatic translation on subtitles provided by video add-ons that actively support translation. Currently, viwX is the only addon known to do so.
The addon is still in a rather rough state, but produces quite reasonable results with the languages I test. Development is primarily focused on translating western European languages, English in particular. Please drop a note on Github discussions if you encounter issues with a particular language, or file an issue at Github
Each time a video is started subtitles.translate checks if the playing addon
has passed the subtitles file location. Viwx is currently the only video
plugin known to do so. If a subtitle file is present translate-subs opens
the file, and offers its contents to an online translation service. The
language to translate to is taken from the Kodi setting
preferred subtitle language found in
Settings > Player > Language. Once
completed the player is instructed to use the translated file. Depending on
the file size and speed of the translation service it takes a little while
before the translated subtitles are shown on screen. Google Translate usually
takes about 15 - 60 seconds to complete.
To be able to translate subtitles, ensure that the playing addon downloads
subtitles. For viwX: open viwX’s setting and enable
Use subtitles whenever
available. This enables downloading of subtitles for the hearing impaired,
which will do very nicely for translate-subs. It is best to leave the
Use coloured subtitles enabled, as it will help translate-subs
prepare texts for translation. If you prefer all subtitles to be shown in
white you can enable
Remove colours in the settings of translate-subs.
Translate-subs has a few settings to adjust subtitles to your personal
preference. The first settings is
Enable automatic translation to enable
translation. There is currently no way of doing manual translation.
Preferred display time of subtitles in seconds
A setting to define the number of seconds subtitles should preferably remain displayed on screen. When the designated display period of a block of subtitles is shorter than the number of seconds defined in this setting, TranslateSubs will stretch the display period to the number of seconds defined here, or to the start of the next block, whichever comes first
This section has a few option to filter out parts of the text intended specifically to assist hearing impaired. There is an option to remove colours and show all subtitles in white, and there are various option to remove sound descriptions and other non-spoken texts, like lyrics of songs. If you don’t need these kind of texts it is advised to enable the filters, since it can drastically reduce file size and thus the speed of translation.
From version 0.2.0 errors can be marked while you watch a video.
If you notice some strange characters, or miss pieces of text while you
watch a video, press the red button on the remote, or the ‘a’ key on a
keyboard. This will copy the relevant info to folder in userdata/service.
To enable error marking via keyboard or remote button, you have to map a button to a function in the addon. The easiest way to do this is to copy the file translation_error_marking.xml to userdata/keymaps on your Kodi system. Check https://kodi.wiki/view/Keymap#Location_of_keymaps for the exact location of the keymaps folder on various operating systems. You have to restart Kodi before these changes take effect.
Head to https://github.com/dimkroon/translate_subs/discussions for question remarks, ideas, or anything else you want to discuss regarding this addon.
This addon is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.