Code Monkey home page Code Monkey logo

Comments (4)

loranger avatar loranger commented on June 9, 2024 1

Thank you for your replies.

I did a step-by-step setup and realized I was not up-to-date, so I reinstall and setup everything, including the new FallbackController I did not call using laravel-localized-routes 2.4 and it seems to work…

Thank you so much for your support, and for your awesome and very convenient packages πŸ‘πŸ»

from laravel-localized-routes.

ivanvermeyen avatar ivanvermeyen commented on June 9, 2024

Hello,

If you look at the Localizer config file, you will find a number of detectors and stores in a specific order.
Each corresponds to a very simpel class that does the logic it needs.
The first supported / detected locale should be returned and stored in every store.

In addition, the browser locale detection is handled by the BrowserLocale package which parses the Request::server('HTTP_ACCEPT_LANGUAGE'). Does this have the expected locale?

https://github.com/codezero-be/browser-locale/blob/c8563bdd0fdce0e6edcce3daeda5b2fddb981f83/src/Laravel/BrowserLocaleServiceProvider.php#L28-L32

Also ensure that the 3 ServiceProviders have been discovered and any cached config is up to date.

from laravel-localized-routes.

ivanvermeyen avatar ivanvermeyen commented on June 9, 2024

I just tried the Chrome plugin on a local project using the setup described in this packages Readme, and I did get the correct locale.

I did have to remove the cookies before reload, and also use a route that did not have a locale in the url, like fr/some-route. A locale in the url will always win, followed by session and cookie.

from laravel-localized-routes.

ivanvermeyen avatar ivanvermeyen commented on June 9, 2024

I'm happy to hear that it's working!
Thanks for the thumbs up!

from laravel-localized-routes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.