![]() |
||||
|
|
||||
[Chameleon] language changeDebbie Pagurek pagurekd@agr.gc.caWed, 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><a href="javascript:setLanguage('fr-CA');">Français</a></DIV>
<DIV> </DIV>
<DIV>It's working. Thanks for your quick reply.</DIV>
<DIV> </DIV>
<DIV>Debbie<BR><BR>>>> Jason Fournier <jfournier@dmsolutions.ca>
03/23/04 05:40PM >>><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. Here's an
example:<BR><BR>$oApp = new MapApp(); // this is the class in index.phtml
which extends <BR>the Chameleon class<BR>$oApp->CWCAddRegionalTemplate(
"en-CA", "mymap_en.html");<BR>$oApp->CWCAddRegionalTemplate( "fr-CA",
"mymap_fr.html");<BR>$oApp->CWCInitialize( $szTemplate, $szMapFile
);<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><a
href="javascript:setLanguage('fr-CA');">Français</a><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>> Hi all,<BR>> can anyone give me some pointers on
how to use the language widget?<BR>> <BR>> <cwc2
type="language"><BR>> <language name="en-CA"/><BR>> <language
name="fr-CA"/><BR>> </cwc2><BR>> <BR>> What are the
supporting things needed to make this work?<BR>> <BR>> I would like
to switch between english and french. What else needs to <BR>> be in my
template files (both the english and french .html files) to <BR>> make the
switch happen? I see that there is a function <BR>>
CWCSetLanguage(szTmpLanguage) in the cwcjsapi.js file - do I need to
<BR>> use this? And if so, how? I'm not sure if that .js file is
for the <BR>> old CWC2 product or not.<BR>> <BR>> Please, anyone
who can provide info for me on how to switch language <BR>> templates, I'd
really appreciate the help.<BR>> <BR>> Thanks,<BR>> 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. |
MapTools.org -- Hosted by DM Solutions Group |