it-bens / simple-words-translator
Translator for simple and widely used words in different languages
Installs: 416
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^8.1
Requires (Dev)
- captainhook/captainhook: ^5.21
- captainhook/plugin-composer: ^5.3
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.10
- phpstan/phpstan-phpunit: ^1.3
- phpunit/phpunit: ^10.5
- symplify/coding-standard: ^12.0
- symplify/easy-coding-standard: ^12.1
README
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
composer require it-bens/simple-words-translator
Usage
use ITB\SimpleWordsTranslator\TranslatorByName; $translator = new TranslatorByName(); $translation = $translator->yes('Deutsch'); // 'Ja' $translation = $translator->no('deutsch'); // 'Nein'
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