DiscipleTools / disciple-tools-webform

Add a lead form to any website and integrate those leads into the Disciple.Tools system. Build custom lead forms through an admin interface, assign leads to dispatcher, and tag with sources. Special security design allows for forms to be served from one system and privately transferred to the Disciple.Tools system.
https://disciple.tools/plugins/webform/
Other
2 stars 6 forks source link

Webform location search in local language #37

Open benmclure opened 3 years ago

benmclure commented 3 years ago

Hi friends!!

Thank you for your wonderful service to us all. I'm having a bit of trouble getting the webform's location search field to perform well in a local language - in our case Azerbaijani. The web app seems to be working fine and I do have mapbox key and google maps key installed.

Screenshot 2021-03-18 at 1 52 43 pm

As you can see in the above picture, I have placed the web form into my website and under the location entry input says "search location" in English and of course the spelling of locations is also in English, which I think would be off putting for some seekers. You can see below that the seach results also come out in English.

Screenshot 2021-03-18 at 1 54 59 pm

If it's not possible to have this field in English. Would it be possible to have a drop down menu for City and then from there the next drop down menu could list neighbourhoods in the chosen city? Of course I could enter all of the dropdown data manually if required.

Many thanks friends!

corsacca commented 3 years ago

My impression with the google key is that if you search in a certain language it will give results in that language. Is that not working for you? I think the "Search Location" is picking up on the default site language. We'll need to dig some to check. You could try disabling both the google key and the mapbox key and using the location grid list. You can create custom locations and/or change the labels available.

benmclure commented 3 years ago

Hi Corsacca, I just deleted the Mapbox and now I think the Geocoding section also disabled the Google API.

How do I create custom locations?

Screenshot 2021-03-18 at 3 43 35 pm

Currently I can create a dropdown but I can't tell the webform builder to map the data from the dropdown to the address or location field. Thanks for taking the time to hlep!

benmclure commented 3 years ago

"I think the "Search Location" is picking up on the default site language."

Would this be the website I have posted the webform to or would that be the website D.T. is installed at?

corsacca commented 3 years ago

The website D.T. is installed at.

micahmills commented 3 years ago

@cwuensche have you worked on this at all? I think I have a fix for this. I will test it out and see.

micahmills commented 3 years ago

So the fix I had doesn't solve the problem. We are declaring a lang attribute on the HTML of the webform iframe, we should probably fix that, but it isn't what is causing the problem. It appears that the Google geocoding api isn't being loaded properly. I started to track it down, but didn't get very far. If a Google geocoding API key is installed, we need to make sure that gets passed in here and that geocoding response is used instead of map box like we are doing in the theme.

micahmills commented 2 years ago

Hey @benmclure I ran across this bug again today, and I think I found a fix for it. It uses the Mapbox and/or Google Geocoding API key but it should allow you to search in a local language. @corsacca and I will look at the Pull Request I just submitted and try to see if we can get this fixed.