-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c118c5e
commit 27d8562
Showing
2 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,82 @@ | ||
# SubtitleTranslator | ||
A subtitle translator for '.srt' files using googletrans | ||
|
||
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. | ||
|
||
## Clone from Github | ||
|
||
```batch | ||
git clone --recursive https://github.com/DnA-IntRicate/SubtitleTranslator.git | ||
``` | ||
|
||
## Examples | ||
|
||
### Any language to English | ||
|
||
```batch | ||
SubtitleTranslator -i InputFile.srt -o OutputFile.srt | ||
``` | ||
|
||
### Turkish to English | ||
|
||
```batch | ||
SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr -d en | ||
``` | ||
|
||
See [Language Codes](https://developers.google.com/admin-sdk/directory/v1/languages) for specifying translation languages. | ||
|
||
## Usage | ||
|
||
```txt | ||
SubtitleTranslator v1.0. | ||
Valid switches: | ||
-i, --in, --input Specify the input file path. | ||
-o, --out, --output Specify the file path to ouput translated file. | ||
-s, --src, --source Specify the source file's language. (Set to 'auto' by default). | ||
-d, --dst, --destination Specify the language to translate to. (Set to 'English (en)' by default). | ||
-q, --quiet Don't output translation results in terminal. | ||
Valid usages: | ||
Convert from any language implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt' | ||
Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr | ||
Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr | ||
Convert explicitly from English explicitly to Urdu: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s en -d ur | ||
``` | ||
|
||
## Building | ||
|
||
### Build | ||
|
||
```batch | ||
go build . | ||
``` | ||
|
||
This will output the executable to the project's root. | ||
|
||
### Install | ||
|
||
```batch | ||
go install . | ||
``` | ||
|
||
This will build the executable to GOPATH. | ||
|
||
## License | ||
|
||
This application is distributed under the [Apache License Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). | ||
|
||
```txt | ||
Copyright 2022 Adam Foflonker | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
``` |