stephanritscher / Simple-Contacts

A contacts app for managing your contacts without ads.
GNU General Public License v3.0
55 stars 2 forks source link

Feature request: Format a postal address according to its country #18

Closed Netpilgrim closed 3 months ago

Netpilgrim commented 7 months ago

On the contact info screen, format postal addresses depending on the country given as part of this address. Basically each one should be displayed the same way you would write it on an envelope to be sent to this address. This wouldn’t change the data stored in the separate fields of the structured ADR value. It would however be nice if the formatted address were included in a VCF export as LABEL parameter.

According to the Universal Postal Union the country name should be written in either English or French, which gives a manageable list of strings to check against. Some of the formatting is already taken care of by the data structure, e.g. placement of street name and house number in relation to each other. What remains is the order of the six data fields (a post office box should be incompatible with a street address) and the insertion of line breaks.

This is probably the kind of thing that will omit a few edge cases at first but with a default format to fall back on it would never be worse than the current behavior. And covering most cases shouldn’t be too much work once a general process for looking up and applying a format exists.

This is actually something I thought was already implemented because saving an address previously created with another app changes how it is formatted on the contact info screen, including capitalizing the country name and displaying the postal code in front of the locality. Since almost all of my contacts with postal addresses are German ones, this is the correct formatting. But as it turns out, the same formatting is used for all addresses, independent of country. (Note: Please let me know if this behavior somehow depends on my phone setup. I think it’s unlikely as I use US localization instead of German.)

stephanritscher commented 3 months ago

Hi Netpilgrim,

your idea seems valid, but I have little time and don't have many adresses / don't write mentionable amounts of mail abroad. I currently try to contribute my changes to the FossifyOrg fork: https://github.com/FossifyOrg/Contacts/pull/57 It might be worth to create a request there if my contribution is accepted.

Best regards, Stephan

Netpilgrim commented 3 months ago

@stephanritscher, thanks for replying to my comment. I totally understand that there’s not enough time for every feature request, especially low-priority ones like this one, and I hope that your contributions will be added to the Fossify app so more users will benefit from them and you won’t have to support them on your own.