bleicker / translation
There is no license information available for the latest version (0.2.12) of this package.
0.2.12
2015-05-16 07:26 UTC
Requires
- bleicker/container: 1.0.*
- bleicker/exception: 1.0.*
- bleicker/objectmanager: 1.1.*
- doctrine/collections: 1.2.*
Requires (Dev)
- phpunit/phpunit: ~4.6
README
Usage
Create your class
<?php
use Bleicker\Translation\AbstractTranslate;
class TranslateAble extends AbstractTranslate {
/**
* @var string
*/
protected $foo;
}
Start to translate
<?php
$object = new TranslateAble();
$translation1 = new Translation('English', 'en', 'EN');
$translation2 = new Translation('German', 'de', 'DE');
$translation3 = new Translation('Austrian', 'de', 'AU');
$object
->addTranslation($translation1, 'foo')
->addTranslation($translation2, 'foo')
->addTranslation($translation3, 'foo');
Getting a translation
<?php
$object->filterTranslationsFor('foo', 'de', 'DE');
$object->filterTranslationsFor('foo', 'de');
$object->filterTranslationsFor('foo');