[Chameleon] Language

Paul Spencer pagameba at magma.ca
Thu Jun 17 15:23:40 EDT 2004


Liz ...

Godwin, Liz wrote:

> I've been muddling around with this since I posted. See inline.
> 
> 
>>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
> 
> 
> Can this be made case-insensitive?  I tried this on my own before your
> response, but used lowercase "language" and it didn't work.  I just
> assumed I couldn't do this.  Maybe this is a bug?

I would say it is a bug, all URL parameters are supposed to be handled 
in a case-insensitive manner.  Can you create the bug please?  Pretty 
Please????

> 
> 
>>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"
> 
> 
> I'm not using a mapfile in this case, but a context document, that
> points to a wms, which is in french or english.  Many (although not all)
> map services are either english OR french like the National Atlas for
> example.  While the above will work with custom mapfile only apps (we
> have those too), it won't work for our more generic ogc apps.  I'm
> thinking of adding code to my index.phtml to evaluate language and then
> use a different context document if applicable.  Although I haven't
> really made up my mind on this one.  I may just call each template using
> a full string (specifying language) instead of changing the language
> because my index.phtml is set up to accept different templates and
> context documents.

um that's more complicated but still doable, I suspect you are probably 
doing it the way I would suggest.

> 
> I have another question about language template handling, and shared
> resources.  The wait image is declared as many times as there are
> languages in all templates.  If you change something in one template, it
> affects that template.  But when it comes to styling (text buttons, nav
> buttons) only those resources defined in the initial template are
> loaded.  So...if you start the session in English, the style shared
> resoures defined in english apply.  Styling defined differently in other
> language templates has no effect. BUT  it is possible to change a
> stylesheet between languages.  

Um .... I see the problem.  I think the caching mechanism is perhaps a 
little too aggressive.  Right now, it caches the actual generated images 
on a per-template basis, but it will actually only load a shared 
resource once per session if caching is used.  I think it can be made to 
work on a per-template basis, but this will cause the session to grow a 
little bigger and reduce performance (perhaps).

> 
> I guess I'm saying that this is inconsistent and hard to follow.  It
> would be my preference to have chameleon accept all shared resources as
> they are in a template, regardless of when they are loaded.  Is
> something that can be changed easily, say by me?  Is it interesting
> enough to others to hope for a change in a future release?

I would actually classify this as a bug. I'll try to address it in one 
of the beta releases.  Can you please file this as a bug (well, you're 
already logging the other one, so it's not much more effort, right ;))

Cheers,

Paul

> 
> Cheers,
> 
> Liz
> 
> 
> 
> -----Original Message-----
> From: Paul Spencer [mailto:pagameba at magma.ca]
> Sent: June 17, 2004 10:43 AM
> To: Godwin, Liz
> Cc: chameleon at lists.maptools.org
> Subject: Re: [Chameleon] Language
> 
> 
> 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/|
>   -----------------------------------------------------------------
> 
> 

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



More information about the Chameleon mailing list