Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove direct references to class Translation #234

Conversation

schlessera
Copy link
Contributor

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

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.
src/Translations.php Outdated Show resolved Hide resolved
@oscarotero oscarotero merged commit 81e6e03 into php-gettext:master Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants