Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidegalilei/nimtranslate
An async Nim library to translate text using Google Translate API.
https://github.com/davidegalilei/nimtranslate
nim translate
Last synced: 12 days ago
JSON representation
An async Nim library to translate text using Google Translate API.
- Host: GitHub
- URL: https://github.com/davidegalilei/nimtranslate
- Owner: DavideGalilei
- License: gpl-3.0
- Created: 2021-02-04T08:01:23.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-17T17:38:48.000Z (almost 4 years ago)
- Last Synced: 2024-11-14T20:43:19.637Z (2 months ago)
- Topics: nim, translate
- Language: Nim
- Homepage:
- Size: 14.6 KB
- Stars: 19
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nimtranslate
A Nim library for translating text using Google Translate API.----
## Features- **Supports emoji**
- **Asynchronous**
- **Easy and Free to use**----
## Quick Start### Installation
Requirements:
- Nim 1.2.0 or higher.```
$ git clone https://github.com/DavideGalilei/nimtranslate
$ cd nimtranslate
$ nimble install
```
----
### Usage[Example:](https://github.com/DavideGalilei/nimtranslate/blob/main/examples/example.nim)
```
import nimtranslate
import asyncdispatchif isMainModule:
let t = newTranslator()
echo t.translate("Hello world! 🌎", toLang="de").waitFor
echo t.detect("Hallo").waitFor
```How to run the example:
```
$ cd examples
$ nim compile -d:ssl --run example.nim
```Output:
```
(raw: ..., text: "Hallo Welt! 🌎", toLang: "de", detectedLang: "en")
de
```
----
## DevelopmentWant to contribute? Pull requests are accepted! :D
----
## License
GNU GPLv3