Actually use the current language in search

This commit is contained in:
Pieter Vander Vennet 2024-07-26 16:03:49 +02:00
parent 2fb87d2011
commit b03ff4f148

View file

@ -2,6 +2,7 @@ import { Utils } from "../../Utils"
import { BBox } from "../BBox"
import Constants from "../../Models/Constants"
import { FeatureCollection } from "geojson"
import Locale from "../../UI/i18n/Locale"
export interface GeoCodeResult {
display_name: string
@ -23,7 +24,7 @@ export class Geocoding {
const b = bbox ?? BBox.global
const url = `${
Geocoding.host
}search?format=json&limit=1&viewbox=${b.getEast()},${b.getNorth()},${b.getWest()},${b.getSouth()}&accept-language=nl&q=${query}`
}search?format=json&limit=1&viewbox=${b.getEast()},${b.getNorth()},${b.getWest()},${b.getSouth()}&accept-language=${Locale.language.data}&q=${query}`
return Utils.downloadJson(url)
}