Thecentury / subtitles-translator

Translates .src subtitles using Yandex Translate API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subtitles Translator

Translates .src subtitles using Yandex Translate API.

Usage

  1. Get Yandex Cloud FolderId and token. Token can be obtained by running Yandex Cloud console api:
yc iam create-token
  1. Build Subtitles Translator.

  2. Run it:

dotnet SubtitlesTranslator.dll --SourceFile=<SourceFileName>.srt --YandexTranslateToken="<Token>" --YandexCloudFolderId="<FolderId>"

One more additional command line switch is TargetLanguageCode allows to set the language code of translation destination. Default value is ru.

Example of translation

en:

1
00:00:04,827 --> 00:00:07,625
<i>* From Mayfair to Park Lane</i>

2
00:00:07,667 --> 00:00:10,181
<i>* You will hear this same refrain</i>

ru:

1
00:00:04,827 --> 00:00:07,625
<i> * от Мейфэра до Парк-Лейн</i>

2
00:00:07,667 --> 00:00:10,181
<i>* Вы услышите этот же рефрен</i>

About

Translates .src subtitles using Yandex Translate API


Languages

Language:C# 66.2%Language:HTML 24.8%Language:CSS 9.0%