schmittjoh / JMSI18nRoutingBundle

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

Locale redirect only works for Homepage #209

Open aik099 opened 6 years ago

aik099 commented 6 years ago

According to documentation (see http://jmsyst.com/bundles/JMSI18nRoutingBundle/master/configuration) the prefix strategy should prefix all routes with locale. It does so, but only when generating/parsing routes.

There is also a fallback redirect for cases, when page without locale is accessed to redirect to same page with locale.

Unfortunately it has several issues:

  1. works only for homepage, e.g. / is redirected to /en/, but /something isn't redirected to /en/something
  2. the 302 redirect is made, but according to SEO it should be 301 redirect instead

File in question: https://github.com/schmittjoh/JMSI18nRoutingBundle/blob/master/EventListener/LocaleChoosingListener.php

rmatcar commented 6 years ago

Hi,

Same issue, Is there an option to achieve this example?

example: (default language is en)

/something -> redirect to /en/something /en/something --> /en/something /fr/something --> /fr/something

Losams commented 6 years ago

Since this morning, the fallback didn't work nether. I continue to investigate.

EDIT It seems to be the symfony 3.4.7 (and the buildin server), I keep looking

djukaPHP commented 6 years ago

Fallback works on symfony 4.0.4 but not on 4.0.8. LocaleChoosingListener is not fired at all.