MapTools.org

[Chameleon] language change

Debbie Pagurek pagurekd@agr.gc.ca
Wed, 24 Mar 2004 08:58:14 -0500
This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=_37161BED.91F092FB
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks very much Jason.
The part that I didn't have an example of was the appropriate javascript
call:
<a href=3D"javascript:setLanguage('fr-CA');">Fran=E7ais</a>

It's working.  Thanks for your quick reply.

Debbie

>>> Jason Fournier <jfournier@dmsolutions.ca> 03/23/04 05:40PM >>>
Debbie,

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

$oApp =3D  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=20
would add a link in your english template similar to:

<a href=3D"javascript:setLanguage('fr-CA');">Fran=E7ais</a>

The MLT should handle translation between English and French for the=20
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?
> =20
> <cwc2 type=3D"language">
> <language name=3D"en-CA"/>
> <language name=3D"fr-CA"/>
> </cwc2>
> =20
> What are the supporting things needed to make this work?
> =20
> 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=20
> make the switch happen?  I see that there is a function=20
> CWCSetLanguage(szTmpLanguage)  in the cwcjsapi.js file - do I need to=20
> use this?  And if so, how?  I'm not sure if that .js file is for the=20
> old CWC2 product or not.
> =20
> Please, anyone who can provide info for me on how to switch language=20
> templates, I'd really appreciate the help.
> =20
> Thanks,
> D. Pagurek


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

--=_37161BED.91F092FB
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Content-Description: HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY style="MARGIN-TOP: 2px; FONT: 10pt Arial; MARGIN-LEFT: 2px">
<DIV>Thanks very much Jason.</DIV>
<DIV>The part that I didn't have an example of was the appropriate javascript 
call:</DIV>
<DIV>&lt;a href="javascript:setLanguage('fr-CA');"&gt;Français&lt;/a&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>It's working.&nbsp; Thanks for your quick reply.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Debbie<BR><BR>&gt;&gt;&gt; Jason Fournier &lt;jfournier@dmsolutions.ca&gt; 
03/23/04 05:40PM &gt;&gt;&gt;<BR>Debbie,<BR><BR>Along with the required 
SharedResource Declaration you will have to add <BR>the following lines just 
before you initialize the application <BR>index.phtml.&nbsp; Here's an 
example:<BR><BR>$oApp =&nbsp; new MapApp(); // this is the class in index.phtml 
which extends <BR>the Chameleon class<BR>$oApp-&gt;CWCAddRegionalTemplate( 
"en-CA", "mymap_en.html");<BR>$oApp-&gt;CWCAddRegionalTemplate( "fr-CA", 
"mymap_fr.html");<BR>$oApp-&gt;CWCInitialize( $szTemplate, $szMapFile&nbsp; 
);<BR><BR>This assumes that you have created mymap_en.html and 
mymap_fr.html.<BR><BR>To switch over, for example, from an English to French 
template you <BR>would add a link in your english template similar 
to:<BR><BR>&lt;a 
href="javascript:setLanguage('fr-CA');"&gt;Français&lt;/a&gt;<BR><BR>The MLT 
should handle translation between English and French for the <BR>widgets you are 
using.<BR><BR>I believe this should do it.<BR><BR>Jason<BR><BR><BR><BR>Debbie 
Pagurek wrote:<BR><BR>&gt; Hi all,<BR>&gt; can anyone give me some pointers on 
how to use the language widget?<BR>&gt;&nbsp; <BR>&gt; &lt;cwc2 
type="language"&gt;<BR>&gt; &lt;language name="en-CA"/&gt;<BR>&gt; &lt;language 
name="fr-CA"/&gt;<BR>&gt; &lt;/cwc2&gt;<BR>&gt;&nbsp; <BR>&gt; What are the 
supporting things needed to make this work?<BR>&gt;&nbsp; <BR>&gt; I would like 
to switch between english and french.&nbsp; What else needs to <BR>&gt; be in my 
template files (both the english and french .html files) to <BR>&gt; make the 
switch happen?&nbsp; I see that there is a function <BR>&gt; 
CWCSetLanguage(szTmpLanguage)&nbsp; in the cwcjsapi.js file - do I need to 
<BR>&gt; use this?&nbsp; And if so, how?&nbsp; I'm not sure if that .js file is 
for the <BR>&gt; old CWC2 product or not.<BR>&gt;&nbsp; <BR>&gt; Please, anyone 
who can provide info for me on how to switch language <BR>&gt; templates, I'd 
really appreciate the help.<BR>&gt;&nbsp; <BR>&gt; Thanks,<BR>&gt; D. 
Pagurek<BR><BR><BR>-- <BR>___________________________<BR>Jason Fournier<BR>DM 
Solutions Group<BR>Application Developer<BR>Ottawa, ON<BR>613.565.5056 x 
18<BR>jfournier@dmsolutions.ca<BR><BR><BR><BR></DIV></BODY></HTML>

--=_37161BED.91F092FB--


This archive was generated by Pipermail.