grote / Transportr

Free Public Transport Assistant without Ads or Tracking
https://transportr.app
GNU General Public License v3.0
1.04k stars 188 forks source link

Add support for address formats in different locales (ie North American where the number of a building precedes the street name) #728

Open AcharyaS97 opened 3 years ago

AcharyaS97 commented 3 years ago

Acknowledgments Please check the following boxes with an x if they apply:

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. E.g. I'm always frustrated when [...]

Something I've noticed is that the address formats when searching for locations, or saved (ie Home/Work) always seemed a bit off. The street name always came before the number (ie Pennsylvania Avenue, 1600, Washington DC) . Being an ignorant Canadian, I've only ever seen addresses written the other way around(1600 Pennsylvania Avenue, Washington, DC), I thought it looked off. I figured it was a European thing but even between countries it seems like the standard differs:

https://www.parcelforce.com/help-and-advice/sending/address-formats-europe

Describe the solution you'd like A clear and concise description of what you want to happen.

An option in app settings where you can pick which address format you want? Different locales might have different conventions which can be customized towards later but as a start just a simple radio button selection in settings where you can pick "Address Format 1" vs "Address Format 2" and have the app display all address locations with either street name first or building number first?

Describe alternatives you've considered A clear and concise description of any alternative solutions you've considered. But please limit this ticket to one feature or use-case.

The only other option I do have is to deal with it and get used to the address format as it is now ;)

Additional context Add any other context or screenshots about the feature request here.

I'm interested in contributing to this project and would love to tackle this addition on my own, if it is deemed worthy of potentially adding.

ialokim commented 3 years ago

559 might be of interest to you. You would have to investigate where the shown order of the address is composed in Transportr. In the Navitia data used as a data source, the label field already adheres to the right order (but not so for e.g. Vienna, Austria): http://canaltp.github.io/navitia-playground/play.html?request=https%3A%2F%2Fapi.navitia.io%2Fv1%2Fcoverage%2Fus-wa%2Fplaces%3Fq%3D1600%2520Pennsylvanian%2520Avenue%26type%255B%255D%3Daddress%26

Until Navitia is aware of different street number orderings, the settings entry in Transportr might be a way to go, or (perhaps better) a hardcoded order for each network provider so that users wouldn't have to bother with it.

AcharyaS97 commented 3 years ago

Thanks, i'll take a look.

AcharyaS97 commented 3 years ago

This turned out to be a little harder then expected, but I've submitted an initial PR #(731) to resolve it. It seems to resolve the glaring issue that I was having when using the search and seeing addresses formatted incorrectly using my local TransportNetwork.