-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
3 changed files
with
68 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,26 @@ Uses Meta's NLLB model [`facebook/nllb-200-distilled-600M`](https://huggingface. | |
|
||
## Installation | ||
|
||
Use `pip` to install Translator (only from source for now). | ||
Use `pip` to install Translator. | ||
|
||
```zsh | ||
pip install git+https://github.com/wasertech/Translator.git | ||
which translate | ||
❯ pip install interpres | ||
``` | ||
|
||
Or from source. | ||
```zsh | ||
❯ pip install git+https://github.com/wasertech/Translator.git | ||
``` | ||
|
||
You can also use a specific version. | ||
```zsh | ||
❯ pip install interpres==0.3.1b4 | ||
❯ pip install git+https://github.com/wasertech/[email protected] | ||
``` | ||
|
||
Locate Translator. | ||
```zsh | ||
❯ which translate | ||
``` | ||
|
||
## Usage | ||
|
@@ -73,14 +88,55 @@ options: | |
|
||
You can `translate` `from` one language `to` another, any `sentence` you would like. | ||
|
||
```zsh | ||
# Translate from English in French | ||
Greet Translator. | ||
``` | ||
❯ translate | ||
ℹ Welcome! | ||
ℹ I am Translator. | ||
ℹ Translator version: 0.3.1b4 | ||
ℹ At your service. | ||
? What would you like to translate? Manually typed sentences | ||
ℹ Translating from: Manually typed sentences | ||
? What language to translate from? en | ||
ℹ Translating from eng_Latn. | ||
? What language to translate to? fr | ||
ℹ Translating to fra_Latn. | ||
ℹ Preparing to translate... | ||
Type [Ctrl] + [C] to exit. | ||
What would you like to translate? | ||
? Translate: This is a prompt-like translation shell! | ||
C'est une coquille de traduction rapide ! | ||
What would you like to translate? | ||
? Translate: You can quickly and effortlessly translate anything from here! | ||
Vous pouvez traduire n'importe quoi rapidement et sans effort. | ||
What would you like to translate? | ||
? Translate: I hope you like my work and are considering becoming a sponsor... | ||
J'espère que vous aimez mon travail et que vous envisagez devenir sponsor... | ||
What would you like to translate? | ||
? Translate: | ||
Cancelled by user | ||
``` | ||
|
||
Translate from English in French. | ||
``` | ||
❯ translate eng_Latn fra_Latn "This is French." | ||
C\'est français. | ||
C'est français. | ||
# Translate from English in Spanish | ||
❯ LANG="fr_CH.UTF-8" translate en "This is also French." | ||
C'est aussi du français. | ||
``` | ||
|
||
Translate from English in Spanish. | ||
```zsh | ||
❯ translate eng_Latn spa_Latn "This is Spanish." | ||
Esto es español. | ||
|
||
❯ translate en es "This is also Spanish." | ||
Esto también es español. | ||
``` | ||
|
||
You can also easily `translate` files from a `--directory` and `--save` to a file. | ||
|
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,6 +1,6 @@ | ||
from translator.translate import Translator | ||
from translator.language import get_nllb_lang | ||
|
||
__version__ = "0.3.1b4" | ||
__version__ = "0.3.1b5" | ||
|
||
LANGS = get_nllb_lang() |
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