CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Country specific address formats
Pages: [1]

Author Topic: Country specific address formats  (Read 6035 times)

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Country specific address formats
November 19, 2008, 03:50:34 am
Hi everyone,

Is there a convenient way of formatting addresses according to the country?

We have quite a few contact from US and from Europe, and some materials need to the main difference in address format requirements is to have for US
 {contact.city}{, }{contact.state_province}{ }{contact.postal_code}
and for Europe
 {contact.postal_code} {contact.city}

I guess that this is currently not supported since such info would have to be defined in the countries table. Where could I look for advice if I decide to hack it in?

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Country specific address formats
November 19, 2008, 04:52:57 am
Quote from: goran on November 19, 2008, 03:50:34 am
Is there a convenient way of formatting addresses according to the country?

No, not yet.

Quote from: goran on November 19, 2008, 03:50:34 am
I guess that this is currently not supported since such info would have to be defined in the countries table. Where could I look for advice if I decide to hack it in?

Is is enough to have one address format per country? For example, do Canadian addresses vary when written in English (as opposed to French)? (Same question for Swiss or Indian addresses, I guess.)
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: Country specific address formats
November 19, 2008, 07:34:52 am
Quote from: Piotr Szotkowski on November 19, 2008, 04:52:57 am
Is is enough to have one address format per country? For example, do Canadian addresses vary when written in English (as opposed to French)? (Same question for Swiss or Indian addresses, I guess.)

In my case it is enough that the format is a function of a country value. To cover all possibilities this could be extended to be a function of a country, province/state with a format table such as:
 country_id, state_province, address_format

In the mean time I am either going to add this functionality or use a custom field for the US postcodes. Then I could have
{contact.postal_code}{ }{contact.city}{, }{contact.state_province}{ }{custom.field}
and get alternative formats without touching the application.

Still I would prefer to do it properly.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Country specific address formats
November 21, 2008, 02:03:30 am
Quote from: goran on November 19, 2008, 07:34:52 am
Quote from: Piotr Szotkowski on November 19, 2008, 04:52:57 am
Is is enough to have one address format per country? For example, do Canadian addresses vary when written in English (as opposed to French)? (Same question for Swiss or Indian addresses, I guess.)

In my case it is enough that the format is a function of a country value. To cover all possibilities this could be extended to be a function of a country, province/state with a format table such as:
 country_id, state_province, address_format

This still doesn’t cover the case I wrote about, which is when an address for the same place changes depending on the language used (English/French, for example). But I assume it’s a rare case, and if we add a per-country address format then that case can be solved with multi-lingual install (with localised civicrm_country.address_format columns).

Quote from: goran on November 19, 2008, 07:34:52 am
In the mean time I am either going to add this functionality or use a custom field for the US postcodes. Then I could have
{contact.postal_code}{ }{contact.city}{, }{contact.state_province}{ }{custom.field}
and get alternative formats without touching the application.

We won’t implement it for CiviCRM 2.2 (which is in feature freeze and will go into code freeze in about a week), but we might consider doing this for CiviCRM 2.3 (and we’re open to suggestions on how to best meet your needs). I filed CRM-3854 to track this.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: Country specific address formats
January 28, 2009, 05:56:51 am
Just a cross link http://forum.civicrm.org/index.php/topic,6335.0.html
Today I realized country specific address formatting standards are even more important on the side of CiviContribute (people do turn away if they can not enter their billing information as they are used to, for example if they are forced to provide State / Province and it is normally not used in particular country).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Country specific address formats

This forum was archived on 2017-11-26.