zerospam / laravel-gettext

Adds localization support to laravel applications using PoEdit and GNU-Gettext.
99 stars 56 forks source link

Inject adapter from binding in service provider #11

Closed terence1990 closed 6 years ago

terence1990 commented 6 years ago

Currently, setting the Adapter in config is not useful unless the binding is injected into Translator, any custom class passed into config is not currently being used.

On line 49 the binding is made to the Application but will only be used when Application needs to resolve dependancy, but since the Translator is receiving the Adapter explicitly the Application does not attempt to resolve it currently - that's not a problem but we just need to make sure what we are passing explicitly is the same as what the Application would resolve, this change fixes that issue.

Belphemur commented 6 years ago

Good point, I'm going to merge what you've done BUT

I'll change the binding for the interface::class, using the string is deprecated and shouldn't be used anymore.

ghost commented 6 years ago

@Belphemur yeah i agree Interface::class is the preferred style