Current locale must be one of the kernel.enabled_locales#71
Conversation
|
@paullla Can you take a look? :) |
Apply the enabled_locales check to the ?locale= query param as well: previously only the Accept-Language path was restricted, so any raw query value still reached the doctrine listener and could be persisted as a translation locale. A non-enabled query locale now falls back to the default locale. Pin the default locale first when negotiating the Accept-Language header: getPreferredLanguage() returns the first element of the list when nothing matches, so without pinning the fallback silently becomes whatever is listed first in framework.enabled_locales instead of kernel.default_locale. Default the new constructor argument to [] so direct instantiation and decoration keep working; an empty list (Symfony's default when framework.enabled_locales is not configured) keeps the previous accept-anything behavior. Documented in the README.
|
Thanks @maxhelias, and sorry for the long wait on this. The change was right, it just needed three adjustments: the same check on the |
No description provided.