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) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Unsupported locale specified to parseStreetAddress
Pages: [1]

Author Topic: Unsupported locale specified to parseStreetAddress  (Read 5482 times)

Joan Nguyen

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.x
  • MySQL version: 5.X
  • PHP version: 5.X
Unsupported locale specified to parseStreetAddress
June 14, 2013, 03:50:14 am
Hi everybody,

I am developing a Civicrm Project in German language.
After I save Address on Contact Summary screen, i get message "Unsupported locale specified to parseStreetAddress: de_DE. Proceeding with en_US locale."
In file modules/civicrm/CRM/Core/BAO/Address.php, i see function parseStreetAddress($streetAddress, $locale = NULL):
(see image attachment)

Code: [Select]
/* locales supported include:
     *  en_US - http://pe.usps.com/cpim/ftp/pubs/pub28/pub28.pdf
     *  en_CA - http://www.canadapost.ca/tools/pg/manual/PGaddress-e.asp
     *  fr_CA - http://www.canadapost.ca/tools/pg/manual/PGaddress-f.asp
     *          NB: common use of comma after street number also supported
     *  default is en_US
     */

    $supportedLocalesForParsing = array('en_US', 'en_CA', 'fr_CA');
    if (!$locale) {
      $locale = $config->lcMessages;
    }
    // as different locale explicitly requested but is not available, display warning message and set $locale = 'en_US'
    if (!in_array($locale, $supportedLocalesForParsing)) {
      CRM_Core_Session::setStatus(ts('Unsupported locale specified to parseStreetAddress: %1. Proceeding with en_US locale.', array(1 => $locale)));
      $locale = 'en_US';
    }

Why do the supported locales only include en_US, en_CA, fr_CA ?
Thanks,
Joan Nguyen
facebook: Joan BrownEyes
skype : doannt2909

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Unsupported locale specified to parseStreetAddress
June 14, 2013, 10:36:15 am
Joan - the reason is that 'rules' for parsing a street address string have ONLY been coded for those 3 locales. The basis for each set of parsing rules is documented in the function header. If you can locate documentation for parsing German street addresses, please submit a patch to extend the function for that locale. Jump on IRC if you need to discuss further.
Protect your investment in CiviCRM by  becoming a Member!

Joan Nguyen

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.x
  • MySQL version: 5.X
  • PHP version: 5.X
Re: Unsupported locale specified to parseStreetAddress
June 16, 2013, 07:31:02 pm
Thanks for your information, Dave Greenberg.

Now, we are proceeding with en_US locale (Is this proceeded in Core CiviCRM?). If having any locate documentation for parsing German street addresses, I will discuss here.

All the best,
Joan Nguyen
facebook: Joan BrownEyes
skype : doannt2909

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Unsupported locale specified to parseStreetAddress

This forum was archived on 2017-11-26.