Searchbox API returns English results despite language parameter (e.g. 'fr')
Nobody has claimed this yet.
- 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:
- *Make API Call: Link
- Observe second result: "Bordeaux Airport"
- It should be localized as "Aéroport de Bordeaux" or "Bordeaux aéroport"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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