diff --git a/Main.go b/Main.go index f4b9183..cf6f435 100644 --- a/Main.go +++ b/Main.go @@ -23,9 +23,9 @@ func Help(exitCode int) { fmt.Print("\n") fmt.Println("Valid usages:") fmt.Println("Convert from any language implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt'") - fmt.Println("Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr") - fmt.Println("Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr") - fmt.Println("Convert explicitly from English explicitly to Urdu: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s en -d ur") + fmt.Println("Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr'") + fmt.Println("Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr'") + fmt.Println("Convert explicitly from English explicitly to Urdu: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s en -d ur'") os.Exit(exitCode) } diff --git a/README.md b/README.md index 8d59654..0510320 100644 --- a/README.md +++ b/README.md @@ -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. +```