Skip to content

Language switch doesn't work with pretty URLs on CRUD controllers #6842

@speller

Description

@speller

Describe the bug
After switching to pretty URLs, I can't switch locale in CRUD controllers anymore.

To Reproduce
Package version: 4.24.4
PHP version: 8.4

Locale configuration in config/packages/translation.yaml:

framework:
  default_locale: ru
  enabled_locales: ['en', 'ru']

Dashboard controller:

    public function configureDashboard(): Dashboard
    {
        return Dashboard::new()
            ->setLocales(['en', 'ru'])
        ;
    }
  1. I'm on the page http://localhost:7000/ru/admin/dashboard/customer (Ru locale)
  2. The locale switcher shows two languages - English and Russian
  3. The En locale link is: http://localhost:7000/ru/admin/dashboard/customer?_locale=en
  4. When I click on the English link, nothing changes, I still see the Russian language page.
  5. If I edit the URL manually to switch to the /en/ URL prefix, I get the No route found for "GET http://localhost:7000/en/admin/dashboard/customer" error.

This issue doesn't happen on the Dashboard http://localhost:7000/ru/admin/dashboard - the link to the English version is correct: http://localhost:7000/en/admin/dashboard and on custom routes (non-CRUD controllers).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions