Skip to content

Commit

Permalink
Wrote README
Browse files Browse the repository at this point in the history
  • Loading branch information
DnA-IntRicate committed Dec 15, 2022
1 parent c118c5e commit 27d8562
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
82 changes: 81 additions & 1 deletion README.md
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.
```

0 comments on commit 27d8562

Please sign in to comment.