php-gettext / Gettext

PHP library to collect and manipulate gettext (.po, .mo, .php, .json, etc)
MIT License
687 stars 134 forks source link

Remove direct references to class `Translation` #234

Closed schlessera closed 4 years ago

schlessera commented 4 years ago

To make the class Translation extensible without introducing bugs, the Translations class was now adapted to accept a class name of a Translation object to use.

This makes sure that when you extend Translation, you can enforce use of that extension even when Translations needs to create new instances of it.

Translation also has a create() method now so that when you have an instance of a translation you can easily create a new one without needing to know the exact class name.

Related issue: #231