mcguffin / acf-openstreetmap-field

WordPress ACF Field for OpenStreetMap
https://wordpress.org/plugins/acf-openstreetmap-field/
GNU General Public License v3.0
107 stars 22 forks source link

Provide accept-language #97

Closed 1ucay closed 1 year ago

1ucay commented 1 year ago

Hello, can you please add accept-language parameter to ACF settings for Nominatim geocode? https://help.openstreetmap.org/questions/38202/is-it-possible-to-specify-a-language-for-results-in-reverse-geocoding Like this, it can be overide via filter - for developer it would be useful. For example we can overide this settings over get_user_locale()

Thank you .

1ucay commented 1 year ago

Sorry, better would be get_locale(), because we need uniform address street across website.

1ucay commented 1 year ago

in acf-osm-frontend.js line #16057

  var params = geocodingParams(this.options, {
    q: query,
    limit: 5,
    'accept-language': window.wp.editor.getDefaultSettings().tinymce.language,
    format: 'json',
    addressdetails: 1
  });
mcguffin commented 1 year ago

1.5.0 introduces a WordPress filter, that should solve your problem. @see https://github.com/mcguffin/acf-openstreetmap-field/wiki/WordPress-Filters#acf_osm_nominatim_options

1ucay commented 1 year ago

Thank you!

1ucay commented 3 months ago

Hello, i just tried in new project and not working. It seems that parameters are not set. https://nominatim.openstreetmap.org/search?q=Warsaw&limit=5&format=json&addressdetails=1