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

Custom translator singleton are overriding by default translator #31067

Closed
elvinas21 opened this issue Jan 8, 2020 · 6 comments
Closed

Custom translator singleton are overriding by default translator #31067

elvinas21 opened this issue Jan 8, 2020 · 6 comments

Comments

@elvinas21
Copy link

  • Laravel Version: 6.10.0
  • PHP Version: 7.2.14
  • Database Driver & Version: mysql 5.7.24

Description:

After I upgraded my Laravel from v6.9.0 to v6.10.0 third party translation library stopped working.
In Laravel v6.9.0 firstly are registering Laravel native 'translator' singleton and after that it registering third party libraries singletons, but in Laravel v6.10.0 firstly are registered third party libraries singleton named 'translator' and after that it will be overridden by Laravel native 'translator' singleton.

It could be caused by this changes: #31009 @GrahamCampbell please check it. Thanks.

Steps To Reproduce:

Use one of the package which extends translations functionality and register translator singleton
I'm using this https://github.com/joedixon/laravel-translation library which takes translations from database

@driesvints
Copy link
Member

I'm not sure how these changes break that package. We'll need some more info on this to determine what has broken.

/cc @joedixon @GrahamCampbell

@joedixon
Copy link
Contributor

I'm going to try and take a look at this tonight.

@joedixon
Copy link
Contributor

@elvinas21, I have a fix coming for this so I think the issue can be closed.

@crynobone
Copy link
Member

It could be caused when 3rd party is loading the service provider as eagered while Laravel translator is deferred.

@joedixon
Copy link
Contributor

Hi @elvinas21, I just pushed a fix to master. Any chance you can pull down and let me know if the issue is resolved?

Thanks,
Joe

@elvinas21
Copy link
Author

Hi @joedixon, i will check, and let you know the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants