|
1 | 1 | # SubtitleTranslator |
2 | | - A subtitle translator for '.srt' files using googletrans |
| 2 | + |
| 3 | +SubtitleTranslator is a barebones command-line subtitle translating application for SRT files written in [Go 1.18](https://go.dev) that utilises [go-googletrans](https://github.com/Conight/go-googletrans) for translations. In-future this application may be extended to be able to arbitrarily translate textfiles of any type. |
| 4 | + |
| 5 | +## Clone from Github |
| 6 | + |
| 7 | +```batch |
| 8 | +git clone --recursive https://github.com/DnA-IntRicate/SubtitleTranslator.git |
| 9 | +``` |
| 10 | + |
| 11 | +## Examples |
| 12 | + |
| 13 | +### Any language to English |
| 14 | + |
| 15 | +```batch |
| 16 | +SubtitleTranslator -i InputFile.srt -o OutputFile.srt |
| 17 | +``` |
| 18 | + |
| 19 | +### Turkish to English |
| 20 | + |
| 21 | +```batch |
| 22 | +SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr -d en |
| 23 | +``` |
| 24 | + |
| 25 | +See [Language Codes](https://developers.google.com/admin-sdk/directory/v1/languages) for specifying translation languages. |
| 26 | + |
| 27 | +## Usage |
| 28 | + |
| 29 | +```txt |
| 30 | +SubtitleTranslator v1.0. |
| 31 | +
|
| 32 | +Valid switches: |
| 33 | +-i, --in, --input Specify the input file path. |
| 34 | +-o, --out, --output Specify the file path to ouput translated file. |
| 35 | +-s, --src, --source Specify the source file's language. (Set to 'auto' by default). |
| 36 | +-d, --dst, --destination Specify the language to translate to. (Set to 'English (en)' by default). |
| 37 | +-q, --quiet Don't output translation results in terminal. |
| 38 | +
|
| 39 | +Valid usages: |
| 40 | +Convert from any language implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt' |
| 41 | +Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr |
| 42 | +Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr |
| 43 | +Convert explicitly from English explicitly to Urdu: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s en -d ur |
| 44 | +``` |
| 45 | + |
| 46 | +## Building |
| 47 | + |
| 48 | +### Build |
| 49 | + |
| 50 | +```batch |
| 51 | +go build . |
| 52 | +``` |
| 53 | + |
| 54 | +This will output the executable to the project's root. |
| 55 | + |
| 56 | +### Install |
| 57 | + |
| 58 | +```batch |
| 59 | +go install . |
| 60 | +``` |
| 61 | + |
| 62 | +This will build the executable to GOPATH. |
| 63 | + |
| 64 | +## License |
| 65 | + |
| 66 | +This application is distributed under the [Apache License Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). |
| 67 | + |
| 68 | +```txt |
| 69 | +Copyright 2022 Adam Foflonker |
| 70 | +
|
| 71 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 72 | +you may not use this file except in compliance with the License. |
| 73 | +You may obtain a copy of the License at |
| 74 | +
|
| 75 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 76 | +
|
| 77 | +Unless required by applicable law or agreed to in writing, software |
| 78 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 79 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 80 | +See the License for the specific language governing permissions and |
| 81 | +limitations under the License. |
| 82 | +``` |
0 commit comments