Prefer place name in UA/browser language

closes #16
This commit is contained in:
2026-02-10 19:19:36 +04:00
parent 87e2380ef6
commit 64ccc694d3
4 changed files with 38 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import Service, { service } from '@ember/service';
import { getLocalizedName } from '../utils/osm';
export default class OsmService extends Service {
@service settings;
@@ -61,7 +62,7 @@ out center;
normalizePoi(poi) {
return {
title: poi.tags?.name || poi.tags?.['name:en'] || 'Untitled Place',
title: getLocalizedName(poi.tags),
lat: poi.lat || poi.center?.lat,
lon: poi.lon || poi.center?.lon,
url: poi.tags?.website,