[Chameleon] language, $oMLT->get not working
Bart van den Eijnden
BEN at Syncera-ITSolutions.NL
Fri Jul 8 03:51:00 EDT 2005
Follow-up on this one.
One of the problems I encountered was that the common\mlt\create_dbf.php script creates columns named EN-CA and FR-CA and it should be EN_CA and FR_CA.
After fixing this, still an empty array is put into the loadResource function in mlt.php. There are checks in the function on empty strings but not on empty arrays.
function loadResource( $szName, $mLang = "" )
so $mLang is an empty array of size 0.
If this happens I made a change to default back to the original language, ie:
elseif ($mLang != "")
{
// Bart, if array size is 0, back to default language
if (sizeof($mLang) == 0) { $mLang = $this->szLanguage; }
foreach ($mLang as $szKey => $szLang)
{
$mLang[$szKey] = preg_replace("/(\W)/", "_", $szLang);
}
}
I still have no idea why an empty array is being passed, this would need some further debugging/investigation. Btw I am working in JSAPI mode, could that have something to do with it?
Paul/Julien, should I open up a bug for the empty array issue and the create_dbf.php issue since I do not have CVS commit rights to php_utils?
Best regards,
Bart
Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG DELFT
tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> "Bart van den Eijnden" <BEN at syncera-itsolutions.nl> 07/05/05 16:08 PM >>>
Hi list,
I am having some trouble getting the widgets in my application to retrieve texts from the dbf files. The common language resource works fine.
I had to perform to following hacks to get things working, but I would be interested to know what my application is missing so I can solve this in a more subtle way.
I had to do the following things:
1) set the language attribute of the $oMLT before retrieving the first text
$oMLT->szLanguage = 'en-CA'; echo $oMLT->get("1", "Geen helptekst gevonden")
2) Had to edit mlt.php around line 345 and set the language:
elseif ( is_array( $mLang ) )
{
$mLang = "en-CA";
So apparently something is wrong with my language settings. How does Chameleon determine the language of the application? Do I need to set it in the index.phtml file? I could not find something in the samples with this respect.
Btw using Chameleon version 2.2.
Btw2, the same problem happens in the sample applications, the default values are used from the phtml files.
Thanks in advance.
Best regards,
Bart
Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG DELFT
tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon
More information about the Chameleon
mailing list