MapTools.org

[Chameleon] language change

Jason Fournier jfournier@dmsolutions.ca
Tue, 23 Mar 2004 17:40:31 -0500
Debbie,

Along with the required SharedResource Declaration you will have to add 
the following lines just before you initialize the application 
index.phtml.  Here's an example:

$oApp =  new MapApp(); // this is the class in index.phtml which extends 
the Chameleon class
$oApp->CWCAddRegionalTemplate( "en-CA", "mymap_en.html");
$oApp->CWCAddRegionalTemplate( "fr-CA", "mymap_fr.html");
$oApp->CWCInitialize( $szTemplate, $szMapFile  );

This assumes that you have created mymap_en.html and mymap_fr.html.

To switch over, for example, from an English to French template you 
would add a link in your english template similar to:

<a href="javascript:setLanguage('fr-CA');">Français</a>

The MLT should handle translation between English and French for the 
widgets you are using.

I believe this should do it.

Jason



Debbie Pagurek wrote:

> Hi all,
> can anyone give me some pointers on how to use the language widget?
>  
> <cwc2 type="language">
> <language name="en-CA"/>
> <language name="fr-CA"/>
> </cwc2>
>  
> What are the supporting things needed to make this work?
>  
> I would like to switch between english and french.  What else needs to 
> be in my template files (both the english and french .html files) to 
> make the switch happen?  I see that there is a function 
> CWCSetLanguage(szTmpLanguage)  in the cwcjsapi.js file - do I need to 
> use this?  And if so, how?  I'm not sure if that .js file is for the 
> old CWC2 product or not.
>  
> Please, anyone who can provide info for me on how to switch language 
> templates, I'd really appreciate the help.
>  
> Thanks,
> D. Pagurek


-- 
___________________________
Jason Fournier
DM Solutions Group
Application Developer
Ottawa, ON
613.565.5056 x 18
jfournier@dmsolutions.ca





This archive was generated by Pipermail.