Add support for multilingual websites using one domain pro language

Created on 3 July 2023, over 1 year ago
Updated 20 October 2023, over 1 year ago

Problem/Motivation

Currently the Restconsumer localization adds the current language to all endpoints throught the localizePath method.
This leads to 404 errors when used on multilingual website using domain and not url as language detection.
Ex: the session token path is rewritten as /de/session/token, which does not exists on such a domain.

Steps to reproduce

Install a drupal website with domain and language module enabled.
Add a language and add a domain.
Specify the URL language detection part as domain: /admin/config/regional/language/detection/url

Proposed resolution

Modify the localizePath method of the Worker.js to use drupalSettings.path.pathPrefix variable instead of the current language to check if a prefix should be added to the endpoint (see provided file)

Remaining tasks

Check for any other incompatibilities

User interface changes

API changes

Data model changes

Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

🇫🇷France GuillaumePacilly

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

Comments & Activities

Production build 0.71.5 2024