I created this issue because of the points described in #2468447: Unable to remove path prefix on language when changed to from default language.

Let's say you install a site in english. Then you add a new language and make that the default one. Now, you would want to make this new language have paths without prefixes.

Right now you would have to do this:

- Go to path prefixes, try to remove the prefix for your language. Get a not so helpful error message about that you can't remove the path prefix when the language is not the default fallback language (see #2486293: Create link to "selected detection fallback language" from error message. for patch for a better error message).
- Go to default fallback language. Realize it is seemingly set to what you want.

If you on the other hand save the form on the default fallback language admin page (to most users this may seem strange that they need to save the form with the value it is already set to) you can now remove the path prefix for your language.

Attached is a gif that illustrates the confusion. The gif has the patch in #2486293: Create link to "selected detection fallback language" from error message. applied, to make it faster to navigate.

All this seems not so user friendly, so here is a patch that assumes that if the config key for selected_langcode is not set, it will act as LanguageInterface::LANGCODE_SITE_DEFAULT (because that is what the admin form indicates, and the default behaviour when the key is not set if I am not mistaken).

Comments

eiriksm’s picture

Status: Active » Needs review
StatusFileSize
new900 bytes
eiriksm’s picture

StatusFileSize
new1 MB

Forgot the GIF, here it is

eiriksm’s picture

Status: Needs review » Closed (duplicate)