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

French address format #77

Open gregoirepuget opened 3 years ago

gregoirepuget commented 3 years ago

Hello,

I'm sorry, i read all issues about changing address format but i don't understand how to do it.

Can you help me please changing "Boulevard de l'Hôpital 140, 75013 Paris, Île-de-France France" to "140 Boulevard de l'Hôpital , 75013 Paris, Île-de-France France"

Thanks

cgarofalo commented 2 years ago

I also have the same question.

@gregoirepuget You can use po/mo or WPML files to "translate" the placeholder strings for the plugin. I need this format in english, so I'm still figuring out how to override the english strings.

The placeholder strings are located in /include/ACFFieldOpenstreetmap/Core/Core.php on line 128. Here: https://github.com/mcguffin/acf-openstreetmap-field/blob/a648c33c3399cd1cfe4d9f4b98918b671f221c41/include/ACFFieldOpenstreetmap/Core/Core.php#L128

In WPML string translation: Screen Shot 2022-08-11 at 4 49 01 PM

Cyrille37 commented 5 months ago

Hi, (with plugin version 1.5.6)

The plugin use the php get_locale() function then set the nominatim query parameter accept-language.

With accept-language=fr nominatim will return a french formatted address.

Query https://nominatim.openstreetmap.org/reverse?lat=47.3794638&lon=0.6814849&zoom=18&addressdetails=1&format=json&accept-language=fr will reply "80 Rue du Général Renault, 37000 Tours, France Centre-Val de Loire"