How to add multiple languages using Lighthouse GraphQL. #2551
Unanswered
M7MMAD-OMAR
asked this question in
Q&A
Replies: 1 comment
-
Hi, First things to know, the Luckily, Laravel got you covered on parsing these priority, and will select the available languages that fit the best. Here is the implementation : $locale = $request->getPreferredLanguage(self::ALLOWED_LOCALIZATIONS);
app()->setLocale($locale); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I have a Laravel project and I want to add multiple languages to it. I have used the library
spatie/laravel-translatable
and set the default language of the project to Turkish. It works and takes the Turkish language. However, my computer's language is English, and I want my project to take the computer's language and return the data in the appropriate language. How can I handle this using Lighthouse? It takes the translation but does not recognize my computer's language.Even though I added the middleware in the
Kernel
class,This is the middleware.
Beta Was this translation helpful? Give feedback.
All reactions