MapTools.org

[Chameleon] language change

Debbie Pagurek pagurekd@agr.gc.ca
Fri, 26 Mar 2004 11:19:09 -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.

--=_02232B16.D8B9C5A0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

If I put that in,
now i get an error that says:

document.forms[0].LANGUAGE has no properties
source file http://latlong24.gis.agr.gc.ca/cwc2/cwc2.php  Line 3110

Debbie

>>> Jason Fournier <jfournier@dmsolutions.ca> 03/26/04 10:26AM >>>
Debbie,

The implementation of the Language widget should be identical in CWC2 as

it is in Chameleon.  Out of curiousity ... if you place the following js

function in the HEAD of your template does it work?:

/**
* set the current language
*/
function setLanguage(szLanguage)
{
    aLanguages =3D new Array();
    aLanguages[aLanguages.length] =3D new Array( "en-CA" );
    aLanguages[aLanguages.length] =3D new Array( "fr-CA" );


    bValid =3D false;
    for( i=3D0; i< aLanguages.length; i++ )
    {
        if ( aLanguages[i][0] =3D=3D szLanguage )
        {
            bValid =3D true;
            break;
        }
    }
    document.forms[0].LANGUAGE.value =3D szLanguage;
    document.forms[0].submit();
    return true;

}

Jason







Debbie Pagurek wrote:

> Hi all,
> I hate to muddy the waters on the Chameleon list, but I also have=20
> the old CWC2 product installed on my systems and I'd like to get the=20
> language translation working there as well.  However, I keep seeing a=20
> javascript error that says that setLanguage is undefined.
> =20
> Jason or anyone else...
> how is the Language widget used in the old CWC2 product?  What is the=20
> difference between implementing it in CWC2 vs the latest Chameleon=20
> version?
> =20
> Thanks for your help.
> =20
> D. Pagurek
>
>
> >>> Jason Fournier <jfournier@dmsolutions.ca> 03/23/04 05:40PM >>>
> 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 =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
> 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
> 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
> > 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.
> >=20
> > Please, anyone who can provide info for me on how to switch language
> > 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
>
>
>

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

--=_02232B16.D8B9C5A0
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>If I put that in,</DIV>
<DIV>now i get an error that says:</DIV>
<DIV>&nbsp;</DIV>
<DIV>document.forms[0].LANGUAGE has no properties</DIV>
<DIV>source file <A 
href="http://latlong24.gis.agr.gc.ca/cwc2/cwc2.php">http://latlong24.gis.agr.gc.ca/cwc2/cwc2.php</A>&nbsp; 
Line 3110</DIV>
<DIV>&nbsp;</DIV>
<DIV>Debbie<BR><BR>&gt;&gt;&gt; Jason Fournier &lt;jfournier@dmsolutions.ca&gt; 
03/26/04 10:26AM &gt;&gt;&gt;<BR>Debbie,<BR><BR>The implementation of the 
Language widget should be identical in CWC2 as <BR>it is in Chameleon.&nbsp; Out 
of curiousity ... if you place the following js <BR>function in the HEAD of your 
template does it work?:<BR><BR>/**<BR>* set the current 
language<BR>*/<BR>function setLanguage(szLanguage)<BR>{<BR>&nbsp;&nbsp;&nbsp; 
aLanguages = new Array();<BR>&nbsp;&nbsp;&nbsp; aLanguages[aLanguages.length] = 
new Array( "en-CA" );<BR>&nbsp;&nbsp;&nbsp; aLanguages[aLanguages.length] = new 
Array( "fr-CA" );<BR><BR><BR>&nbsp;&nbsp;&nbsp; bValid = 
false;<BR>&nbsp;&nbsp;&nbsp; for( i=0; i&lt; aLanguages.length; i++ 
)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( 
aLanguages[i][0] == szLanguage )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bValid = 
true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; document.forms[0].LANGUAGE.value = 
szLanguage;<BR>&nbsp;&nbsp;&nbsp; 
document.forms[0].submit();<BR>&nbsp;&nbsp;&nbsp; return 
true;<BR><BR>}<BR><BR>Jason<BR><BR><BR><BR><BR><BR><BR><BR>Debbie Pagurek 
wrote:<BR><BR>&gt; Hi all,<BR>&gt; I hate to muddy the waters on the Chameleon 
list, but I also have <BR>&gt; the old CWC2 product installed on my systems and 
I'd like to get the <BR>&gt; language translation working there as well.&nbsp; 
However, I keep seeing a <BR>&gt; javascript error that says that setLanguage is 
undefined.<BR>&gt;&nbsp; <BR>&gt; Jason or anyone else...<BR>&gt; how is the 
Language widget used in the old CWC2 product?&nbsp; What is the <BR>&gt; 
difference between implementing it in CWC2 vs the latest Chameleon <BR>&gt; 
version?<BR>&gt;&nbsp; <BR>&gt; Thanks for your help.<BR>&gt;&nbsp; <BR>&gt; D. 
Pagurek<BR>&gt;<BR>&gt;<BR>&gt; &gt;&gt;&gt; Jason Fournier 
&lt;jfournier@dmsolutions.ca&gt; 03/23/04 05:40PM &gt;&gt;&gt;<BR>&gt; 
Debbie,<BR>&gt;<BR>&gt; Along with the required SharedResource Declaration you 
will have to add<BR>&gt; the following lines just before you initialize the 
application<BR>&gt; index.phtml.&nbsp; Here's an example:<BR>&gt;<BR>&gt; $oApp 
=&nbsp; new MapApp(); // this is the class in index.phtml which extends<BR>&gt; 
the Chameleon class<BR>&gt; $oApp-&gt;CWCAddRegionalTemplate( "en-CA", 
"mymap_en.html");<BR>&gt; $oApp-&gt;CWCAddRegionalTemplate( "fr-CA", 
"mymap_fr.html");<BR>&gt; $oApp-&gt;CWCInitialize( $szTemplate, $szMapFile&nbsp; 
);<BR>&gt;<BR>&gt; This assumes that you have created mymap_en.html and 
mymap_fr.html.<BR>&gt;<BR>&gt; To switch over, for example, from an English to 
French template you<BR>&gt; would add a link in your english template similar 
to:<BR>&gt;<BR>&gt; &lt;a 
href="javascript:setLanguage('fr-CA');"&gt;Français&lt;/a&gt;<BR>&gt;<BR>&gt; 
The MLT should handle translation between English and French for the<BR>&gt; 
widgets you are using.<BR>&gt;<BR>&gt; I believe this should do 
it.<BR>&gt;<BR>&gt; Jason<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; Debbie Pagurek 
wrote:<BR>&gt;<BR>&gt; &gt; Hi all,<BR>&gt; &gt; can anyone give me some 
pointers on how to use the language widget?<BR>&gt; &gt; <BR>&gt; &gt; &lt;cwc2 
type="language"&gt;<BR>&gt; &gt; &lt;language name="en-CA"/&gt;<BR>&gt; &gt; 
&lt;language name="fr-CA"/&gt;<BR>&gt; &gt; &lt;/cwc2&gt;<BR>&gt; &gt; <BR>&gt; 
&gt; What are the supporting things needed to make this work?<BR>&gt; &gt; 
<BR>&gt; &gt; I would like to switch between english and french.&nbsp; What else 
needs to<BR>&gt; &gt; be in my template files (both the english and french .html 
files) to<BR>&gt; &gt; make the switch happen?&nbsp; I see that there is a 
function<BR>&gt; &gt; CWCSetLanguage(szTmpLanguage)&nbsp; in the cwcjsapi.js 
file - do I need to<BR>&gt; &gt; use this?&nbsp; And if so, how?&nbsp; I'm not 
sure if that .js file is for the<BR>&gt; &gt; old CWC2 product or not.<BR>&gt; 
&gt; <BR>&gt; &gt; Please, anyone who can provide info for me on how to switch 
language<BR>&gt; &gt; templates, I'd really appreciate the help.<BR>&gt; &gt; 
<BR>&gt; &gt; Thanks,<BR>&gt; &gt; D. Pagurek<BR>&gt;<BR>&gt;<BR>&gt; -- 
<BR>&gt; ___________________________<BR>&gt; Jason Fournier<BR>&gt; DM Solutions 
Group<BR>&gt; Application Developer<BR>&gt; Ottawa, ON<BR>&gt; 613.565.5056 x 
18<BR>&gt; jfournier@dmsolutions.ca<BR>&gt;<BR>&gt;<BR>&gt;<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>

--=_02232B16.D8B9C5A0--


This archive was generated by Pipermail.