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) »
  • localization string disappear after memcache enabled
Pages: [1]

Author Topic: localization string disappear after memcache enabled  (Read 3629 times)

jimyhuang

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 3
localization string disappear after memcache enabled
June 20, 2010, 04:19:14 am
After I tried to enable the memcache of CiviCRM by this add this line into civicrm.settings.php, the translated string will force to English.

Code: [Select]
define( 'CIVICRM_USE_MEMCACHE'  , 1 );
But when I look into config of localization, I find the localize settings is still there(non-English), only missing translated string.

I didn't spent much time to look into code. Just a quick question for there are anyone have this issue. Or is it just a configuration problem before enable memcache in CiviCRM?

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: localization string disappear after memcache enabled
June 25, 2010, 06:04:10 am
I don’t recall explicitly seeing this issue, but the PHP gettext library we use does seem to cache the MO file it uses for getting the string translations; can this be the culprit?
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.

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
Re: localization string disappear after memcache enabled
December 13, 2010, 01:34:43 am
I have the same issue. I enabled another language and some of the content/menus is translated while using memcache, but not at the level when memcache is disabled.

Is there a fix for this?

Without a fix we cannot use memcache with civicrm sites in other languages.
Basically memcache and internationalization together is not working.

Thank you
Casti

jimyhuang

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 3
Re: localization string disappear after memcache enabled
December 13, 2010, 01:52:15 am
Yep the issue is still there.
I tried to figure out this issue, but still have enough time to do that.

jimyhuang

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 3
Re: localization string disappear after memcache enabled
February 16, 2011, 12:52:05 pm
Seems the when enable memcache, settings of config add unnecessary string to parameter "templateCompileDir" and "configAndLogDir".

I insert the debug message in the CRM/Core/Config.php to see what's the difference between memcached enabled and disabled.
I found that before enabled, the object of CRM_Core_Config is correct:
=================================
CRM_Core_Config Object
(
    [dsn] => mysql://netivism:netivism123@localhost/netivism_civicrm?new_link=true
    [userFramework] => Drupal
    [userFrameworkURLVar] => q
    [userFrameworkDSN] => mysql://netivism:netivism123@localhost/netivism_drupal?new_link=true
    [templateCompileDir] => /var/www/civicrm.netivism.tw/sites/civicrm.netivism.tw/files/civicrm/templates_c/zh_TW/
    [configAndLogDir] => /var/www/civicrm.netivism.tw/sites/civicrm.netivism.tw/files/civicrm/templates_c/zh_TW/ConfigAndLog/
    [initialized] => 0
    [DAOFactoryClass:private] => CRM_Contact_DAO_Factory
...
=================================
But after print out cached object of CRM_Core_Config, the compile dir seems error.
=================================
CRM_Core_Config Object
(
    [dsn] => mysql://netivism:netivism123@localhost/netivism_civicrm?new_link=true
    [userFramework] => Drupal
    [userFrameworkURLVar] => q
    [userFrameworkDSN] => mysql://netivism:netivism123@localhost/netivism_drupal?new_link=true
    [templateCompileDir] => /var/www/civicrm.netivism.tw/sites/civicrm.netivism.tw/files/civicrm/templates_c/en_US/zh_TW/
    [configAndLogDir] => /var/www/civicrm.netivism.tw/sites/civicrm.netivism.tw/files/civicrm/templates_c/en_US/ConfigAndLog/
    [initialized] => 0
    [DAOFactoryClass:private] => CRM_Contact_DAO_Factory
...
=================================
Maybe there is a typo of some program.

jimyhuang

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 3
Re: localization string disappear after memcache enabled
March 23, 2011, 08:50:30 am
After using dirty method "str_replace" to correct the loading config, translation worked with memcache!
I did't look into the config loading procedure. It must have something wrong there.

jimyhuang

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 3
Re: localization string disappear after memcache enabled
April 20, 2012, 07:59:25 am
/For lobo mention about the issue again. I think the problem is because smarty generate local file in wrong path.
As I mention about, before memcache enabled, the object of CRM_Core_Config is correct(maybe not correct, but worked.)

After the enable the memcache, the config dir loaded from memory cached result is wrong.

=================================
Before enable memcached, compile dir is correct.
=================================
Code: [Select]
CRM_Core_Config Object
(
    [templateCompileDir] => /var/www/civicrm.netivism.tw/sites/civicrm.netivism.tw/files/civicrm/templates_c/zh_TW/
    [configAndLogDir] => /var/www/civicrm.netivism.tw/sites/civicrm.netivism.tw/files/civicrm/templates_c/zh_TW/ConfigAndLog/
    [initialized] => 0
    [DAOFactoryClass:private] => CRM_Contact_DAO_Factory
...
=================================
But after print out cached object of CRM_Core_Config, the compile dir seems error.
=================================
CRM_Core_Config Object
(

    [templateCompileDir] => /var/www/civicrm.netivism.tw/sites/civicrm.netivism.tw/files/civicrm/templates_c/en_US/zh_TW/
    [configAndLogDir] => /var/www/civicrm.netivism.tw/sites/civicrm.netivism.tw/files/civicrm/templates_c/en_US/ConfigAndLog/
    [initialized] => 0
    [DAOFactoryClass:private] => CRM_Contact_DAO_Factory

But when using memcache, not only the localization issue, but also have cached result never refresh issues.
Such as event list, profile list, some option values ... these cache never refresh. Then I give up using memcache because too many user experience problem for now on CiviCRM.

I think the cache system need more work for "clear correspond cache when save" process.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • localization string disappear after memcache enabled

This forum was archived on 2017-11-26.