Compatibility with language detection by URL method configured with Path prefix

Created on 28 December 2024, 4 months ago

Problem/Motivation

I'm using this module in a multilanguage site, where I need to use the language detection by URL method, configured with path prefix, the problem is that when I create new domains and I access them if I try to change the language nothing happens, that is, the language is not changed in the microsite. In the main site everything works as expected because the core language module gets the langcode of first element of the path, and this module also gets the microsite name from first element of the path, for example: if the domain of my site is example.org and I create a domain record named site1, if try to change the interface language to spanish, the final url would be:

https://example.org/site1/es

The core's language module tries to get the langcode using "site1", as it doesn't match the available languages it returns null and the interface language doesn't change at all.

Steps to reproduce

  1. Follow the installation instructions for this module, then go to Configuration -> Regional and language -> Languages -> Detection and selection (/admin/config/regional/language/detection), enable detection method by URL, set the order to give priority to URL method and Save settings.
  2. Add your required languages at /admin/config/regional/language
  3. Go to any microsite and try to change the language. The site will remain in the default language.

Proposed resolution

Since not everyone requires this feature, I propose the creation of a submodule that, when activated, will allow this module to work correctly with the language detection by URL method.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇲🇽Mexico ovilla

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024