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

Extension\Laravel\Translator in Lumen #367

Open
jpedryc opened this issue Sep 3, 2019 · 0 comments
Open

Extension\Laravel\Translator in Lumen #367

jpedryc opened this issue Sep 3, 2019 · 0 comments

Comments

@jpedryc
Copy link

jpedryc commented Sep 3, 2019

Hi

The situation: I'm currently trying to move a working Laravel app to Lumen. It's a renderer-style app which - based on a JSON - glues up twig view files with some parameters and renders the view.

Main problem: A chain of unresolved dependencies.

In README.md I can find:

For Lumen, you need to load the same Service Provider, but you have to disable the Auth, Translator and Url extensions in your local configuration.

I have a lot of twig view files where the function trans([3]) is being used, my main goal is to get that to work. First, I tried the default twig extension Twig_Extensions_Extension_I18n - the function is being found, however it's not the same thing = trans([1]).

Second approach was to get the Laravel extension to work by adding manually some dependencies as the errors occur, but that seems to be reinventing the wheel.

Did create a Translator based on the Illuminate\Translation\Translator and a Loader based on Illuminate\Contracts\Translation\Loader (singletons). Stopped doing that after the next one:
Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\Manager.

Do you have some ideas how to tackle this issue? Am I missing something while bootstrapping Lumen?

Thanks in advance

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

No branches or pull requests

1 participant