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) »
  • Errors with regards to chinese local long/short mapping
Pages: [1]

Author Topic: Errors with regards to chinese local long/short mapping  (Read 1553 times)

sussdorff

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 4
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
Errors with regards to chinese local long/short mapping
August 11, 2011, 12:31:35 am
With the automated calls to /sites/all/modules/civicrm/extern/open.php and /sites/all/modules/civicrm/bin/civimail.cronjob.php we get errors in this code (errors in red):

    /**
     * Get the locale set in the hosting CMS
     * @return string  with the locale or null for none
     */
    static function getUFLocale()
    {
        // return CiviCRM?s xx_YY locale that either matches Drupal?s Chinese locale
        // (for CRM-6281), Drupal?s xx_YY or is retrieved based on Drupal?s xx
   global $language;
        switch (true) {
   case $language->language == 'zh-hans':             return 'zh_CN'; Trying to get property of non-object
        case $language->language == 'zh-hant':             return 'zh_TW'; Trying to get property of non-object
   case preg_match('/^.._..$/', $language->language): return $language->language;
   default:
            require_once 'CRM/Core/I18n/PseudoConstant.php'; Undefined offset: 0 in sites/all/modules/civicrm/CRM/Core/I18n/PseudoConstant.php on line 59
            return CRM_Core_I18n_PseudoConstant::longForShort(substr($language->language, 0, 2)); Trying to get property of non-object
        }
    }


Any idea what might cause this? Additionally it looks like CiviCRM is not using the drupal locale setting for the user (we have to have a locale switch on our Web site so the users can switch to the English / German version when going to CiviCRM pages). I have a feeling we might have forgotten something, but maybe the two errors are unrelated.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Errors with regards to chinese local long/short mapping
August 11, 2011, 07:39:48 am

what version is this? Is it: D7 / Civi 4.0.x? If so, i think drupal changed the language stuff a bit, and that part of the code might not have been upgraded. Can you take a look and figure out what the equivalent D7 code is

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

osarusan

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7.26
  • MySQL version: 5.4.13
  • PHP version: 5.5.31
Re: Errors with regards to chinese local long/short mapping
January 03, 2013, 12:37:50 pm
Sorry to resurrect an old topic, but googling around this is the only thing I've found.

I'm having this exact problem on my Drupal 7/CiviCRM installation. The error comes up constantly in our error logs.

Our site does not use Chinese text, but it does use English and Japanese...

Has anyone figured out what needs to be fixed for this?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Errors with regards to chinese local long/short mapping
January 03, 2013, 08:51:11 pm

dont think so, but would be great if you can debug and figure out what needs to be done

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Errors with regards to chinese local long/short mapping

This forum was archived on 2017-11-26.