Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedie authored Jun 8, 2023
1 parent 9c685ab commit 6faaa6c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[PyPI](https://pypi.org/project/srtranslator/)

```
```bash
pip install srtranslator
```

Expand All @@ -16,7 +16,7 @@ pip install srtranslator

Import stuff

```
```python
import os
from srtranslator import SrtFile
from srtranslator.translators.deepl_api import DeeplApi
Expand All @@ -26,13 +26,13 @@ from srtranslator.translators.translatepy import TranslatePy

Initialize translator. It can be any translator, even your own, check the docs, there are instructions per translator and how to create your own.

```
```python
translator = DeeplTranslator() # or TranslatePy() or DeeplApi(api_key)
```

Load, translate and save. For multiple recursive files in folder, check `examples folder`

```
```python
filepath = "./filepath/to/srt"
srt = SrtFile(filepath)
srt.translate(translator, "en", "es")
Expand All @@ -45,7 +45,7 @@ srt.save(f"{os.path.splitext(filepath)[0]}_translated.srt")

Quit translator

```
```python
translator.quit()
```

Expand All @@ -55,7 +55,7 @@ translator.quit()

## Usage command line

```
```bash
python -m srtranslator ./filepath/to/srt -i SRC_LANG -o DEST_LANG
```

Expand Down

0 comments on commit 6faaa6c

Please sign in to comment.