SRT-subtitle translator

SRT-subtitle translator is a program or script which can help you make a translation for a video. At first you need to make an original srt-file, which can do using Kdenlive. YouTube has a good video about that.

Speech to Text https://docs.kdenlive.org/en/effects_and_compositions/speech_to_text.html

SRT_TRASLATOR-packages.zip

Rpm-package is made from deb-package using Alien, so you need to install yad by hand in rpm-version.

RPM-package with dependecies, made using RPMCreator

rpm-srt-translator.zip

The script:

#!/bin/bash
##
##
### RJP 11.11.2023 https://puolanka.info/goto/srt-subtitle-translator/
##
time=$(date "+%F-%H-%M-%S")
yad --width=1000 --text='Choose srt-file for translating. File selection opens when you close this window.'
sleep 0,1
OLD=`yad --file --width=1000`
yad --width=1000 --text='Choose text-file for making a new translated srt-file. You may have made the file by hand or you may have made it using artificial intelligence.'
sleep 0,1
NEW=`yad --file --width=1000`
sed '1i\\' $NEW > /tmp/NEWFILE2
sed -r '/^\s*$/d' $OLD > /tmp/NEWFILE
sed '1d' /tmp/NEWFILE2 | sed -e '3~3{R /dev/stdin' -e 'd;}' /tmp/NEWFILE > /tmp/file2.srt
awk '{ print; } NR % 3 == 0 { print ""; }' /tmp/file2.srt > $HOME/file-$time.srt
yad --width=1000 --text='New translation has made from your text-file. You can use the file when you watching the video or you can burn the text to video using program like Kdenlive. You find the file from your home directory as file-timestamp.here.srt.'
cd /tmp && rm NEWFILE NEWFILE2 file2.srt
exit

Read also: https://www.puolanka.org/goto/srt-subtitle-translator/nerd-dictation-and-vosk-installation/

Linkit