[Chameleon] Language

Paul Spencer pagameba at magma.ca
Thu Jun 17 10:43:16 EDT 2004


Liz,

the correct(?) way, or at least the way I intended it to work, is to 
register templates for specific languages.  Chameleon will then choose 
the correct template for the current language regardless of which 
template you call the CWCExecute function with ...

The Language widget has no interface, it just provides a JavaScript 
function that you can call on your own to set the language.  This 
function sets the current language and submits the page.

The javascript function is setLanguage( szLanguageCode )

The form variable that tracks the current language is LANGUAGE

This means that you can initialize your application in either English or 
French by:

http://<server>/<app>/index.phtml?LANGUAGE=en-CA
http://<server>/<app>/index.phtml?LANGUAGE=fr-CA

regardless of what you put in the CWCExecute call ...

Re: the legend template problem, I would suggest that you use two 
different legend templates in the two different application templates. 
They can be identical except for the metadata that they choose to 
display, and then you can place translations directly in the MAP file on 
a layer-by-layer basis in the metadata, for instance:

"wms_title_en" "English Title"
"wms_title_fr" "French Title"



Godwin, Liz wrote:

> An observation has led me to approach dual language pages differently.  
> Perhaps someone can point me in the right direction If there's a better way.
>  
> Original problem:  When changing the language of a page, the legend 
> stays in the original language, English in my case, because the map 
> file/context doc is not changed, only the template.  So I have an 
> incomplete French page.  I understand this, because right now... when 
> the language is changed the map content stays the same, and all session 
> info stored.
>  
> But I don't want to use bilingual layer titles/metadata/queries.
>  
> Plan A:  bring up the page manually so I can call the french 
> template/context file myself.
>  
> Problem:  there seems to be no way to identify the language of a page.  
> The "Language" widget...well..I don't know what this DOES other to state 
> what other languages are available.  For my purposes I don't see the 
> point of this seeing as I have to load the language templates manually 
> in the index.phtml file anyway.  Anyway, if I can identify a template as 
> english or french, (en-ca/fr-ca) then i was hoping chameleon would 
> notice and apply the right language to my pop-up widgets. 
>  
> Thoughts...please help!
>  
> Liz Godwin
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 
  -----------------------------------------------------------------
|Paul Spencer                           pspencer at dmsolutions.ca   |
|-----------------------------------------------------------------|
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
  -----------------------------------------------------------------



More information about the Chameleon mailing list