mapbox / mapbox/mapbox-gl-js

Searchbox API returns English results despite language parameter (e.g. 'fr')

Open
#13,468 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

mapbox-gl-js version: 3.11.0
browser: Chrome 136 on Linux

Hello Mapbox team,

I'm using the Mapbox Searchbox API with the suggest and retrieve endpoints. I'm using the language=fr parameter. However, the results returned often remain in English, even when the requested language is clearly specified and supported.
For example, when searching for "Bordeaux":

{
  "name": "Bordeaux Airport",
  "language": "fr",
  "poi_category": ["aéroport"],
  ...
},
{
"name": "Bordeaux Museum Fine Arts",
"name_preferred": "Bordeaux Museum of Fine Arts",
"language": "fr",
"poi_category": [
                "musée",
                "attraction touristique"
            ],
...
}

Despite language=fr, the name is "Bordeaux Airport" instead of the expected localized version, such as "Aéroport de Bordeaux". Similarly, for "Bordeaux Museum Fine Arts", the API returns English even though name_preferred, context, and poi_category show that the French context is correctly detected.

Problem:

The language field claims to be "fr", but the actual name or name_preferred is in English.

Expected Behavior:

When language=fr is specified, all returned name and name_preferred fields should be in French, not just metadata like categories or context.

Impact:
  • This leads to a mixed-language UI, which confuses users and breaks localization expectations
  • Requires manual filtering or overrides, which are not scalable
  • Reduces the effectiveness of localized applications using the Searchbox API
Steps to reproduce:
  1. *Make API Call: Link
  2. Observe second result: "Bordeaux Airport"
  3. It should be localized as "Aéroport de Bordeaux" or "Bordeaux aéroport"

*Request URL: https://docs.mapbox.com/playground/search-box/suggest-retrieve/?q=bordeaux&session_token=0d512dbd-e62c-4b78-8196-90efdffd0cfa&language=fr&proximity=-73.990593%2C40.740121&country=fr&endpoint=suggest

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the linked Searchbox suggest/retrieve request with language=fr and compare name and name_preferred with the localized metadata. No repository file or test is identified; first determine whether the behavior belongs to mapbox-gl-js or the external Searchbox API, then verify the resolution with the same request and expected French output.

Written by the indexing model from the issue text.

Assessment

Domain
api, localization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.