[Chameleon] Billingual method of selecting map file?

Ken Sanderson ken at rockies.ca
Fri Sep 24 18:21:39 EDT 2004


Thanks for the reply Jason. Where does mszCurrentLanguage get set?
$oApp['mszCurrentLanguage'] doesn't return anything from what I can
tell, so I assume I need to set that somewhere?

Ken

-----Original Message-----
From: Jason Fournier [mailto:jfournier at dmsolutions.ca] 
Sent: September 24, 2004 3:59 PM
To: Ken Sanderson
Cc: chameleon at lists.maptools.org
Subject: Re: [Chameleon] Billingual method of selecting map file?


Ken,

You could detect the current language through something like:

$oApp['mszCurrentLanguage'] in your index.phtml before you call:

$oApp->CWCInitialize( $szTemplate, $szMapFile  );

if this string is null then you are using your default your default 
language <else> this variable will contain the key of the language you 
are in (eg, en-CA, fr-CA, etc.).

So in semi-pseudo code you could:
$szMapName = 'mymap';
if( language == 'fr-CA' )
   $szMapLang = 'fr';
else
   $szMapLang = 'en';

$szMapFile = $szMapName . '_' . $szMapLang . '.map';
$oApp->CWCInitialize( $szTemplate, $szMapFile );

This assumes that you have two mapfiles called:

mymap_en.map
mymap_fr.map

HTH,
Jason



Ken Sanderson wrote:

> I have setup the billingual tools and I see how they are selecting 
> different templates based on your language choice, but is there a way 
> to also select a different MAP file to use so that I can make my layer

> names Billingual as well?
> 
> Thanks,
> 
> Ken
> 
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org 
> http://lists.maptools.org/mailman/listinfo/chameleon
> 

-- 
_____________________________

   Jason Fournier

   DM Solutions Group Inc.
   jfournier at dmsolutions.ca
   www.dmsolutions.ca
   613.565.5056 x18





More information about the Chameleon mailing list