[Chameleon] Billingual method of selecting map file?

Jason Fournier jfournier at dmsolutions.ca
Fri Sep 24 17:59:21 EDT 2004


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