Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juancarlospaco/nim-tinyslation
Text string translation from free online crowdsourced API. Tinyslation a tiny translation. Nim package.
https://github.com/juancarlospaco/nim-tinyslation
nim nim-lang traduction translation
Last synced: 21 days ago
JSON representation
Text string translation from free online crowdsourced API. Tinyslation a tiny translation. Nim package.
- Host: GitHub
- URL: https://github.com/juancarlospaco/nim-tinyslation
- Owner: juancarlospaco
- License: mit
- Created: 2018-05-02T22:45:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-06T18:13:12.000Z (over 5 years ago)
- Last Synced: 2024-08-04T01:15:34.524Z (3 months ago)
- Topics: nim, nim-lang, traduction, translation
- Language: Nim
- Size: 348 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-nim - tinyslation - Text string translation from free online crowdsourced API. (Text / Translation)
README
# nim-tinyslation
- Text string translation from free online crowdsourced API.
Tinyslation a tiny translation. Sync and Async support (MultiSync).
No API Key required. Works with and without SSL `-d:ssl`. No Auth required.![screenshot](https://source.unsplash.com/Oxl_KBNqxGA/800x402 "Illustrative Photo by https://unsplash.com/@foxfox")
![screenshot](temp.png "Tinyslation working as standalone App.")
# Use
```nim
>>> import translation
>>> echo MMT().tinyslation("white cat", to="es") # Sync.
"gato blanco"
>>>
>>> proc async_translation {.async.} = echo await AsyncMMT().tinyslation("black dog", to="es")
>>> wait_for async_translation() # Async.
"perro negro"
```# Install
```
nimble install translation
```# Requisites
- [Nim](https://nim-lang.org)
# Documentation
tinyslation()
**Description:**
Text string translation from [free online crowdsourced API](http://mymemory.translated.net).
The proc does not accept `char` only `string`.**Arguments:**
- `text` A text to translate, `string` type, required.
- `to` A target language to translate on ISO 2-char language code, `string` type, eg. `"en"` or `"es"`, required.
- `from` A source language to translate on ISO 2-char language code, `string` type, eg. `"en"` or `"es"`, optional, defaults to `"en"`, required.
- `timeout` A Timeout, `int8` type, optional.**Returns:** A translated text string, `string` type.