Pseudolocalization
, (*1)
Pseudo language generator, (*2)
Requirements
How to Install
$ composer require yoannrenard/pseudolocalization
Test it
$ vendor/bin/phpunit
Usage
Using the default pseudolocalization translation :, (*3)
use YoannRenard\Pseudolocalization\TranslatorFactory;
$translator = TranslatorFactory::create();
echo $translator->trans('Lorem ipsum');
// [£ôřè₥ ïƥƨú₥ Lorem ip]
Using a config DTO class :, (*4)
use YoannRenard\Pseudolocalization\Config;
use YoannRenard\Pseudolocalization\TranslatorFactory;
$translator = TranslatorFactory::create(new Config(true, 'upper', true, true));
echo $translator->trans('Lorem ipsum');
// [£ÓRÉM ÌÞ§ÛM Lorem]
Using the whole bunch of transformers :, (*5)
use YoannRenard\Pseudolocalization\Translator;
use YoannRenard\Pseudolocalization\Transformer\TransformerChain;
use YoannRenard\Pseudolocalization\Transformer\TransformerFactory;
$translator = new Translator(new TransformerChain([
TransformerFactory::create('alternate_case'),
TransformerFactory::create('diacritics'),
]));
echo $translator->trans('Lorem ipsum');
// £ôRèM Ìƥ§úM