MapTools.org

[Chameleon] language change

Debbie Pagurek pagurekd@agr.gc.ca
Thu, 25 Mar 2004 09:54:59 -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.

--=_63424CDB.8FEE8DF9
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi all,
I hate to muddy the waters on the Chameleon list, but I also have the
old CWC2 product installed on my systems and I'd like to get the
language translation working there as well.  However, I keep seeing a
javascript error that says that setLanguage is undefined.

Jason or anyone else...
how is the Language widget used in the old CWC2 product?  What is the
difference between implementing it in CWC2 vs the latest Chameleon
version?

Thanks for your help.

D. Pagurek


>>> 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

--=_63424CDB.8FEE8DF9
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>Hi all,</DIV>
<DIV>I hate to muddy the waters on the Chameleon list, but I also have 
the&nbsp;old CWC2 product installed on my systems and I'd like to get the 
language translation working there as well.&nbsp; However, I keep seeing a 
javascript error that says that setLanguage is undefined.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Jason or anyone else...</DIV>
<DIV>how is the Language widget used in the old CWC2 product?&nbsp; What is the 
difference between implementing it in CWC2 vs the latest Chameleon 
version?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for your help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>D. Pagurek</DIV>
<DIV><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>

--=_63424CDB.8FEE8DF9--


This archive was generated by Pipermail.