Bugs item #614322, was opened at 2002-09-25 06:49
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=104754&aid=614322&group_id=4754

Category: Tapestry
Group: bug
Status: Open
Resolution: None
Priority: 5
Submitted By: Tzvetelin (tzvetelin)
Assigned to: Howard Lewis Ship (hship)
Summary: ICompStrings doesn't change with Locale

Initial Comment:
IComponentStrings doesn�t change when the locale 
changes in IEngine.
I think this is necessary, because if an application 
receives a user request to change its locale, a 
component will use the old localized strings, since it 
caches them.
One possible implementation is to cache the 
IComponentStrings in IComponentStringSource instead 
of the component itself, make the implementation a 
locale listener of IEngine, and have it flush its cache 
when the Locale changes.


----------------------------------------------------------------------

>Comment By: Howard Lewis Ship (hship)
Date: 2003-01-28 17:56

Message:
Logged In: YES 
user_id=26816

I may have to kludge component strings in some way; the 
problem is, once you are inside a listener method of a loaded 
page, the locale for the page is fixed, as is the strings.  It 
may take a two pass to get the right localized messages, i.e.

public class ThisPage ...
{
public void listener(IRequestCycle cycle)
{
  getEngine().setLocale(foo);

  ThisPage thisPage = (ThisPage)cycle.getPage("ThisPage");

  thisPage.continueListener(cycle);
}

public void continueListener(IRequestCycle cycle)
{
   setMessage(getString(...)));
}


----------------------------------------------------------------------

Comment By: Christian Sell (csell)
Date: 2003-01-15 13:43

Message:
Logged In: YES 
user_id=105319

for reference, heres my usage scenario

On one of my pages, I am using an Insert component with a
string-binding parameter. On the same page, I have a form
with a Select component which allows setting the Locale.
After setting the locale, the same page is redisplayed.

Now it turns out that when the locale is set, the Insert
element does not change its appearance according to the new
locale. Only after visiting another page and returning to
the previous one, the new localized string is shown.

----------------------------------------------------------------------

Comment By: Christian Sell (csell)
Date: 2003-01-15 13:39

Message:
Logged In: YES 
user_id=105319

the problem is two-fold:

1. as the request describes, localized strings are cached in
the component after creation and do not change even if the
engine locale is changed. That means that if the same
component is rendered after changing the locale, it displays
the wrong strings. The only workaround is to force a
redirect, which causes the component to be recreated.

2. the class StringBinding implements the isInvariant()
method by returning true. That means that the binding is
only evaluated once after the component is created, so that
even if the strings were updated (see 1.), they would not be
accessed.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=104754&aid=614322&group_id=4754


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to