It is currently Sun Jul 20, 2008 11:02 am
Moderators: ot2sen, akede, ivo.apostolov, General Support Moderators




cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ENG
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ESP
function _setFileName($id, $group)
{
global $mosConfig_lang;
if ($mosConfig_lang == english )
{
$idioma = "_ENG";
}
if ($mosConfig_lang == spanishi )
{
$idioma = "_ESP";
}
if ($this->_fileNameProtection) {
$this->_file = ($this->_cacheDir.'cache_'.md5($group).'_'.md5($id).$idioma);
} else {
$this->_file = $this->_cacheDir.'cache_'.$group.'_'.$id.$idioma;
}
}



The changes we did wasn't in the CacheLite files but in the files that called this class. 






array2001 wrote:
Sure, I am far from being a php coder, so the altered code is not probably the best approach, anyhow it works and as it is a really small change I didn't bother trying to get it better written.
The idea is to distinguish between languages in the cache generated files, so I have added a flag at the end of every cache file name: ENG for English piece of content, and ESP for Spanish piece of content:
- Code: Select all
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ENG
cache_94afbfb2f291e0bf253fcf222e9d238e_0a44f3ad03329c1101771b2cea700cb2_ESP
The code change in file includes/Cache/Lite.php is as follows:
function _setFileName($id, $group)
{
global $mosConfig_lang;
if ($this->_fileNameProtection) {
$this->_file = ($this->_cacheDir.'cache_'.md5($group).'_'.md5($id).$mosConfig_lang);
} else {
$this->_file = $this->_cacheDir.'cache_'.$group.'_'.$id.$mosConfig_lang;
}
}

This way you don't need to alter the code again if you add additional languages... which was a problem of the code I sent originally.
/**
* Make a file name (with path)
*
* @param string $id cache id
* @param string $group name of the group
* @access private
*/
function _setFileName($id, $group)
{
global $mosConfig_lang;
if ($this->_fileNameProtection) {
$this->_file = ($this->_cacheDir.'cache_'.md5($group).'_'.md5($id).'_'.$mosConfig_lang);
} else {
$this->_file = $this->_cacheDir.'cache_'.$group.'_'.$id.'_'.$mosConfig_lang;
}
}



gaupe wrote:Hmm i have implemented this on my website but found out there's still a sort of problem with the caching
(it is'nt there if you turn the cache off so it must be the cache that causes it.)
I checked it on the webite mentioned http://www.conscious-robots.com and it shows the same behaviour.
This is that if you click on a story and therewith open it in the main window. and then from there choose another language.
It, not allways, shows the same article but in many cases another (previous cached?) article....
I'm not sure what causes this nor do i know how to solve it, somebody any ideas?


gaupe wrote:Hmm i have implemented this on my website but found out there's still a sort of problem with the caching
(it is'nt there if you turn the cache off so it must be the cache that causes it.)
I checked it on the webite mentioned http://www.conscious-robots.com and it shows the same behaviour.
This is that if you click on a story and therewith open it in the main window. and then from there choose another language.
It, not allways, shows the same article but in many cases another (previous cached?) article....
I'm not sure what causes this nor do i know how to solve it, somebody any ideas?




So I keep on using JoomSEF, Joomla Cache and JF 1.8, and finally I can switch any content from one language to another without a problem. 
Return to Joom!Fish and Multilingual Sites
Users browsing this forum: No registered users and 1 guest