schmittjoh / JMSI18nRoutingBundle

Allows you to internationalize your routing
http://jmsyst.com/bundles/JMSI18nRoutingBundle
358 stars 159 forks source link

Don't set "hl" cookie not using "prefix" strategy #210

Open aik099 opened 6 years ago

aik099 commented 6 years ago

The comments in code about hl cookie says that it's used in custom strategy where each language has own sub-domain.

In reality however that cookie is set in prefix strategy as well and in there it's better to use default locate when not specified in url rather than previously used locale, that is coming from cookie.

gitcerizead commented 5 years ago

Hmm, I confess to be relying on this feature, because I thought it formed part of a wider (undocumented) "sticky locale" mechanism that this bundle uses; see https://github.com/schmittjoh/JMSI18nRoutingBundle/issues/229 .

However, it's certainly the case that the stickiness is achieved through the use of the cookie alone (not, for example, the session var), which might indicate that the stickiness feature is not really intended; in which case the use of the cookie for the 'prefix' and 'prefix_except_default' strategies is indeed a bug.

[If the stickiness feature is intended, then I suggest using the session var for it as well, and then making the feature more configurable (including the ability to disable the use of the cookie); see my feature request at https://github.com/schmittjoh/JMSI18nRoutingBundle/issues/230 .