Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/it-bens/simple-words-translator
Translator for simple and widely used words in different languages
https://github.com/it-bens/simple-words-translator
translation
Last synced: about 1 month ago
JSON representation
Translator for simple and widely used words in different languages
- Host: GitHub
- URL: https://github.com/it-bens/simple-words-translator
- Owner: it-bens
- License: mit
- Created: 2024-02-04T21:41:31.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-03-23T19:08:48.000Z (10 months ago)
- Last Synced: 2024-04-24T12:26:13.598Z (9 months ago)
- Topics: translation
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Words Translator
[![Tests](https://github.com/it-bens/simple-words-translator/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/it-bens/simple-words-translator/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/it-bens/simple-words-translator/graph/badge.svg?token=5GAY79HI5U)](https://codecov.io/gh/it-bens/simple-words-translator)A simple problem with a simple solution.
This is a simple package that provides translations for defined words like "yes" and "no" (in english). The desired language can be passed by name or or ISO code (2 letter).
## Installation
```bash
composer require it-bens/simple-words-translator
```## Usage
```php
use ITB\SimpleWordsTranslator\TranslatorByName;$translator = new TranslatorByName();
$translation = $translator->yes('Deutsch'); // 'Ja'
$translation = $translator->no('deutsch'); // 'Nein'
``````php
use ITB\SimpleWordsTranslator\TranslatorByIsoCode;$translator = new TranslatorByIsoCode();
$translation = $translator->yes('de'); // 'Ja'
$translation = $translator->no('de'); // 'Nein'
```The package provides interfaces for the two translators. All translations implement the `ITB\SimpleWordsTranslator\Translation` interface.
## Supported Languages
* German
* English
* Spanish
* French
* Italian
* Dutch