Open gitcerizead opened 5 years ago
It's worth noting, however, that the "stickiness" is achieved solely through the use of a cookie called 'hl', which may be being set in error (i.e. the stickiness feature may be a bug rather than a feature!). See #210 .
But even it's decided to remove the stickiness feature, it would still be good to document how the default locale is determined for a route for which "translation" (i18n) is disabled, as per the description in this ticket.
Documentation request
This bundle implements a "sticky locale" functionality that is more sophisticated than the example approach given in the Symfony documentation at https://symfony.com/doc/3.4/session/locale_sticky_session.html in that it uses not only a session param called _locale, but also a query string param or cookie called 'hl', and browser lang prefs (via the Accept-Language header).
In my own code, I've commented about this as follows:
Since the sticky locale is only applied on routes for which i18n is disabled (although of course if the user visits an i18n-enabled route the explicit locale from that URL is the value that's made sticky), the appropriate place in the documentation would be http://jmsyst.com/bundles/JMSI18nRoutingBundle/master/usage#leaving-routes-untranslated I think.