Autocomplete does not take into account language for multilingual sites

Created on 1 February 2024, 10 months ago
Updated 19 February 2024, 9 months ago

Problem/Motivation

The autocomplete ajax call to the geocoder API is always in the default interface language of the site.
On multilingual sites, the autocomplete will always be in the same language because the call to the geocoder API does not take into account the current language prefix. The current language of the geocoder API route is used as locale.

Steps to reproduce

  • Instal Geocoder
  • Multilingual setup
  • Have an input field that uses the geocoder autocomplete functionality in the different languages
  • Use the autocomplete functionality on a non-default language page
  • The autocomplete results will always be in the default language

Proposed resolution

  • Update geocoder.drupal.js so path prefix (= language prefix) is used when composing the geocoder API URL

Please note that autocomplete functionality is broken in 8.x-4.21, see 🐛 Autocomplete JS not working Fixed . If you are using this version of geocoder, this patch is needed to make this work.

Remaining tasks

🐛 Bug report
Status

Fixed

Version

4.21

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024