After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 659876 - Allow disable of contact's address auto-formatting
Allow disable of contact's address auto-formatting
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
3.2.x (obsolete)
Other Linux
: Normal trivial
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2011-09-22 20:47 UTC by Ian B. MacDonald
Modified: 2013-09-13 01:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (4.47 KB, patch)
2011-09-30 16:28 UTC, Dan Vrátil
needs-work Details | Review
Fixed patch (3.75 KB, patch)
2011-10-05 15:13 UTC, Dan Vrátil
reviewed Details | Review
Fixed patch (3.69 KB, patch)
2011-10-07 12:47 UTC, Dan Vrátil
committed Details | Review

Description Ian B. MacDonald 2011-09-22 20:47:59 UTC
Running Evolution 3.1.91 on Ubuntu 11.10

Steps to reproduce:
a) Add a new Local contact
b) Enter an address with a country (I used home address)
c) Save the contact

The contact address appears in ALL-CAPS. Clearing the country field and re-saving returns the address case to normal.
Comment 1 Milan Crha 2011-09-23 13:29:59 UTC
Thanks for a bug report. I suppose this is rather because of a standard form how to write address in the respective country. This is algorithmized since bug #636809. If you feel your country has this set false, then feel free to provide a change in addressbook/gui/widgets/address_formats.dat for your country.
Comment 2 Ian B. MacDonald 2011-09-23 16:59:34 UTC
haha.  Let me express my concern with laughter.  https://bugzilla.gnome.org/show_bug.cgi?id=636809#c9

That patch raises a few questions in my mind. First of all it has nothing to do with "my country".  It sets the locale formatting to "the country of my friends" which varies and makes little sense.. shouldn't it be set to the country of my post office?. After all that is where the formatting is being dictated.

If I am in Germany, and want to mail to a Canadian address, my labels get formatted in a way that Canada Post wants - and my local German Post office gets confused. Is that correct? Maybe. 

I hope the requirement to format based on destination (address locale) and not sender (host machine locale) is actually right .. as basically this means inconsistent format depending on whether a country is specified in your contact. 

I would argue in most cases, when the country is omitted is when the local locale formatting should apply, and maybe then only. 

Anyways, the end result is that 
a) Contacts with country omitted are not formatted consistently
b) My local post office has to deal with all these locale formats of my friends
c) The local addressbook and google addressbook behave differently

Workaround: Move all your contacts to Google.
Comment 3 Ian B. MacDonald 2011-09-23 17:12:56 UTC
So it seemed worth a Google .. I found this quote from "Frank" at Columbia referencing one of the sort-of standards bodies on this:

"It should also be noted that addressing guidelines are incidental to the UPU's primary mission, which is creating standards for the description of postal addresses (that is, defining and naming the elements), not for their rendition, which is left to each country."

I happen to totally agree, and Capitalization is "rendition". Go ahead and change the elements to match local state, canton, province or whatever local line formatting is required to get them there, but leave my Proper Nouns with a Captial followed by a lowercase when I write them in the English language.

http://www.columbia.edu/~fdc/postal/ 

My 2c - I use Google contacts anyways, but I think this patch needs rethinking.
Comment 4 Milan Crha 2011-09-27 10:36:39 UTC
(I'm CC'ing author of the initial patch)

Dan, could you share your opinion on above comments, please?
Comment 5 Dan Vrátil 2011-09-29 09:45:41 UTC
Since the original bug was requested to provide exactly this functionality and apparently not everybody likes it, we agreed with Milan to add a switch to make the formatting optional, otherwise the old behavior will be applied. The option will not affect existing contacts, only newly created/edited ones.
Comment 6 Milan Crha 2011-09-29 11:57:38 UTC
Yup, and to have this available for 3.2.x users, the option will be hidden in 3.2.x (even without schema), to not add new translatable strings and UI into the code.
Comment 7 Dan Vrátil 2011-09-30 16:28:17 UTC
Created attachment 197889 [details] [review]
Proposed patch

This patch adds View->Enable Address Formatting menu option and a gconf value. When enabled, address are formatted according to standard in country they point to (current behavior), otherwise a universal address format is used (behavior prior to bug #636809).

By default the option is set to TRUE so that behavior introduced in Evo 3.0 is not disabled without any obvious way how to turn it on again. I'd suggest to disable it by default when the UI element is committed.
Comment 8 Milan Crha 2011-10-03 09:32:19 UTC
Thanks for a patch, only two things with it:

a) you can leak the 'client' in set_address_label()

b) do not add the option into menu, user preferences are in Edit->Preferences, and for contacts view in the Contacts section. Add it there, please.
Comment 9 Dan Vrátil 2011-10-05 15:13:57 UTC
Created attachment 198347 [details] [review]
Fixed patch

- fixed possible memleak
- added checkbox to Preferences -> Contacts (maybe we should rename autocompletion-config.c to something else since it contains configuration for another things as well)
Comment 10 Milan Crha 2011-10-06 19:37:41 UTC
I do not expect gconf_client_get_default() ever return NULL, thus rather
   client = gconf_client_get_default ();
   value = gconf_client_get (client, ...);
   g_object_unref (client);

   if (value) { ...

s/it's/its/ in "Format address according to standard of it's destination country"

add a free mnemonic letter to tha above string

Fix the warning:
   e-contact-editor.c: In function 'set_address_label':
   e-contact-editor.c:2307:15: warning: unused variable 'key' [-Wunused-variable]

----------------------------------------------------

When you've those four above things fixed, commit the whole patch to master branch and only the change from file e-contact-editor.c to gnome-3-2. Thanks. You can update the final patch here too, if you want to.
Comment 12 André Klapper 2011-10-07 14:16:38 UTC
Commit to gnome-3-2 broke the string freeze - see gnome-i18n@ mailing list.
Comment 13 Dan Vrátil 2011-10-07 14:25:36 UTC
I'm sorry, my mistake. I have reverted the string change in commit 0ece877.
Comment 14 Ian B. MacDonald 2011-10-19 13:26:20 UTC
I applied the original patch with the handy string and just tested prior to my 3.2.1 upgrade and observed the following results.

1) Added an address to an existing contact without one, and observed the default capitalization when using country=Canada
2) Removed the country and confirmed the capitalization dissappeared
3) Unchecked the "_Format according to the standard of its destination country" checkbox
4) Added country = "Canada" back in, and the formatting Capitalized again.

Its not affecting Google contacts, which I use primarily, but I wanted to test again before pulling down yesterday's ubuntu merge of 3.2.1 

When the string is removed, what is the best way to configure this option?
Comment 15 Milan Crha 2011-10-20 06:43:31 UTC
(In reply to comment #14)
> 4) Added country = "Canada" back in, and the formatting Capitalized again.

Is this a typo? I would expect 'not' at the end, as you have the option unset/false.

> When the string is removed, what is the best way to configure this option?

The easiest might be a command line like this:
   $ gconftool-2 --set --type=bool \
        /apps/evolution/addressbook/display/address_formatting false
Comment 16 Ian B. MacDonald 2011-10-20 17:13:17 UTC
No typo, unchecked option should result in normal rendition. (No capitalization)
Comment 17 Milan Crha 2011-10-20 17:32:40 UTC
Hmm, I think I do not follow. I'm sorry for that. Does it mean that the above is a confirmation that the patch works as expected?
Comment 18 Ian B. MacDonald 2011-10-23 14:14:13 UTC
My observations were incorrect, or at least current patch on 3.2.1 is working. thanks
Comment 19 Milan Crha 2011-10-24 08:55:15 UTC
Good, thanks for confirmation.