[Fwd: [Chameleon] MLT CVS problems]

Eijnden, B. van den (Bart) b.vdeijnden at agi.rws.minvenw.nl
Thu Mar 9 01:52:20 EST 2006


Just reporting back some findings on this.

If I remove the strtolower calls in mlt.php, and also use lowercase for my
language in chameleon.xml (so nl-nl), all works fine. I do not need to set
$_SESSION['aszLang'] or call the CWCAddRegionalTemplate function.

I have fixed bug 1331 though in my local copy:

http://bugzilla.maptools.org/show_bug.cgi?id=1331

I'll try to look into bug 1332 as well today:

http://bugzilla.maptools.org/show_bug.cgi?id=1332

Norm, when do you want to take a decision on altering all language files to
the ISO standard (en-CA versus en-ca)? I am also in favour of this approach,
but it would be handy for me to know since I am about to generate all
language files.

Best regards,
Bart

-----Oorspronkelijk bericht-----
Van: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org]Namens Paul Spencer
Verzonden: woensdag 8 maart 2006 19:35
Aan: Bart van den Eijnden (OSGIS)
CC: chameleon at lists.maptools.org
Onderwerp: Re: [Fwd: [Chameleon] MLT CVS problems]


I just updated locally and I get the same version as Bart

On 8-Mar-06, at 1:12 PM, Bart van den Eijnden (OSGIS) wrote:

> Norman,
>
> can you please confirm the changes you refer to in 2) are in CVS?
>
> I just did an update from CVS and got the same version from mlt.php  
> (revision 1.23, July 2005) which contains the strtolower.
>
> cvs update -P -- mlt.php (in directory C:\php_utils\src\mlt\)
>
> With respect to 1), I'll file a bug tomorrow.
>
> Best regards,
> Bart
>
> Normand Savard wrote:
>
>>
>>>
>>> -------------------------------------------------------------------- 
>>> ----
>>>
>>> Subject:
>>> [Chameleon] MLT CVS problems
>>> From:
>>> "Bart van den Eijnden" <bartvde at xs4all.nl>
>>> Date:
>>> Wed, 8 Mar 2006 14:18:32 +0100 (CET)
>>> To:
>>> chameleon at lists.maptools.org
>>>
>>> To:
>>> chameleon at lists.maptools.org
>>>
>>>
>>> Hi list,
>>>
>>> Question in advance, what is the correct way to load a different  
>>> language?
>>> I have done the following:
>>> a) set nl-NL in chameleon.xml
>>> b) $_SESSION['aszLang'] = array( "NL_NL" );
>>>
>>> If I do not set b) I get the encoding problem as specified in MT  
>>> bug 1329.
>>>
>>>
>> There is a known issue described in bug 961.  Right now to make it  
>> works you need to set the language in chameleon.xml all lower case  
>> and the same for the '$aszLang' session variable.  You also use  
>> "-" instead of "_".  If you use the Link widget in the template,  
>> you should modify the language string as well.
>>
>>> I have run into a few problems with the latest MLT CVS code:
>>>
>>> 1) it seems to me txt resources are only loaded from the  
>>> chameleon widgets
>>> dir, and not for other widget directories specified.
>>>
>>> The code in WidgetManager.php does only the following so this  
>>> goes wrong
>>> for widgets not present in the chameleon widget dir:
>>>
>>>               $this->moMLT->loadResource( $oWidget->mszWidgetName,
>>>                                            str_replace("\\","/",
>>>                                            dirname(__FILE__) ).'/ 
>>> widgets/'.
>>>                                            $oWidget- 
>>> >mszWidgetName );
>>>
>>>
>> For this one I think we should open a new bug and I will look at  
>> it as soon as I completed bug 1329.
>>
>>> 2) For popup phtmls, I have a problem with the case and name (-  
>>> versus _)
>>> of the text resource files. Using the dbf2text.php file the  
>>> following is
>>> created:
>>>
>>> [bart at hades GeoservicesBoundingBoxPopup]$ ll *.txt
>>> -rw-rw-r--    1 bart     geo           424 Mar  7 10:34
>>> GeoservicesBoundingBoxPopup.en-ca.txt
>>> -rw-rw-r--    1 bart     geo           475 Mar  7 10:34
>>> GeoservicesBoundingBoxPopup.fr-ca.txt
>>> -rw-rw-r--    1 bart     geo           300 Mar  7 10:34
>>> GeoservicesBoundingBoxPopup.nl-nl.txt
>>>
>>> But the php code is looking for ($szResourceFile in loadResource):
>>> geoservicesboundingboxpopup.NL_NL.txt
>>>
>>>
>> Actually with respect to the language part of the string, it looks  
>> for the key set by  CWCAddRegionalTemplate chameleon method that  
>> sets the session variable $aszLang or by using what you suggest in  
>> 1b above.  So in your case it should look for "NL_NL".  The  
>> language resource files name are all writen in lower case and this  
>> why they are not found.  If we follow the ISO standard we must  
>> rename our language resource files as follow:  "language- 
>> COUNTRY" (e.g. fr-CA).
>>
>> With respect to the widget name part of the language resource  
>> files name it looks for a combination of upper and lower case  
>> characters as in "GeoservicesBoundingBoxPopup".  The strtolower()  
>> function in mlt loadresource() and get() methods have been  
>> removed.  You should update your mlt.php file.
>>
>>> 3) There also seems to be a problem with the case and - versus _  
>>> of my
>>> language.
>>>
>>> The MLT array uses NL_NL for the language key. The szLanguage  
>>> variable of
>>> the MLT object is nl-NL. So I had to manually override it in  
>>> order to get
>>> it to work:
>>>
>>> $oMLT->szLanguage ='NL_NL';
>>>
>>>
>> See below point 2.
>>
>>
>
>
> -- 
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+




_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon


Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
informeren. Wij adviseren u om bij twijfel over de juistheid of de 
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************



More information about the Chameleon mailing list