You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martin Carel <ma...@pricerunner.com> on 2006/02/17 12:52:05 UTC

Re: How do you use Tapestry? - forcing the locale

Speaking of which, I have this in my application file:

<meta key="org.apache.tapestry.accepted-locales" value="en" />


And I do have a custom Engine in which I have:

public void setLocale(Locale locale) {
       
  if (getLocale() == null) {
    super.setLocale(Locale.ENGLISH);
  } else {
    super.setLocale(locale);
  }       
}

And still, for the fields having a Required validator (in a form with 
clientValidationEnabled="true"), I do have validation error messages in 
Swedish (client machine's regional options are set for Sweden), although 
I would expect them to be in English.

I also tried to put setLocale(Locale.English) in my Engine's 
constructor, or have:

public void setLocale(Locale locale) {
    super.setLocale(Locale.ENGLISH);
}


Still, validation error messages in Swedish!

Any idea why?

/M

Raul Raja Martinez wrote:
> I, as an example, have to force locales, How would I go for doing so 
> with no .application file?
>
>
> Patrick Casey wrote:
>>     I have a .application file. Personally this strikes me as one of
>> those behaviors which seem newbie friendly (see, you can start it up 
>> without
>> having to make a .application file!) but really aren't (the 
>> documentation
>> keeps talking about the .application file, but I don't seem to *have* 
>> one!
>> What's going on!).
>>
>>     I'm sure somewhere, somebody is dependent on the functionality
>> though :).
>>
>>     --- Pat
>>
>>> -----Original Message-----
>>> From: Geoff Longman [mailto:glongman@gmail.com]
>>> Sent: Thursday, February 16, 2006 2:35 PM
>>> To: Tapestry users
>>> Subject: How do you use Tapestry?
>>>
>>> Tapestry will install a fake .application file if you don't have one.
>>> No physical file but an internal object is created that has a path in
>>> the context.
>>>
>>> How many developers out there using Tapestry 4 depend on this 
>>> behaviour?
>>>
>>> Personally, think it would be useful for someone learning how to use
>>> the framework but I come from the old days when the .application was
>>> mandatory. I always use one by habit so this feature of Tapestry is
>>> not a biggie for me.
>>>
>>> I'm curious as to how many people are building apps with Tapestry 4,
>>> large or small, and don't have a .application file.
>>>
>>> Geoff
>>>
>>> -- 
>>> The Spindle guy.          http://spindle.sf.net
>>> Get help with Spindle:
>>> http://lists.sourceforge.net/mailman/listinfo/spindle-user
>>> Blog:                     http://jroller.com/page/glongman
>>> Feature Updates:          http://spindle.sf.net/updates
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you use Tapestry? - forcing the locale

Posted by Martin Carel <ma...@pricerunner.com>.
 > made sure tapestry *really* uses your engine's class?

Yes it does. The proof is that I override the activateExceptionPage() in 
this same custom Engine and it works fine.

/Martin

Ron Piterman wrote:
> made sure tapestry *really* uses your engine's class?
> ron
>
> Martin Carel wrote:
>> Speaking of which, I have this in my application file:
>>
>> <meta key="org.apache.tapestry.accepted-locales" value="en" />
>>
>>
>> And I do have a custom Engine in which I have:
>>
>> public void setLocale(Locale locale) {
>>        if (getLocale() == null) {
>>    super.setLocale(Locale.ENGLISH);
>>  } else {
>>    super.setLocale(locale);
>>  }       }
>>
>> And still, for the fields having a Required validator (in a form with 
>> clientValidationEnabled="true"), I do have validation error messages 
>> in Swedish (client machine's regional options are set for Sweden), 
>> although I would expect them to be in English.
>>
>> I also tried to put setLocale(Locale.English) in my Engine's 
>> constructor, or have:
>>
>> public void setLocale(Locale locale) {
>>    super.setLocale(Locale.ENGLISH);
>> }
>>
>>
>> Still, validation error messages in Swedish!
>>
>> Any idea why?
>>
>> /M
>>
>> Raul Raja Martinez wrote:
>>
>>> I, as an example, have to force locales, How would I go for doing so 
>>> with no .application file?
>>>
>>>
>>> Patrick Casey wrote:
>>>
>>>>     I have a .application file. Personally this strikes me as one of
>>>> those behaviors which seem newbie friendly (see, you can start it 
>>>> up without
>>>> having to make a .application file!) but really aren't (the 
>>>> documentation
>>>> keeps talking about the .application file, but I don't seem to 
>>>> *have* one!
>>>> What's going on!).
>>>>
>>>>     I'm sure somewhere, somebody is dependent on the functionality
>>>> though :).
>>>>
>>>>     --- Pat
>>>>
>>>>> -----Original Message-----
>>>>> From: Geoff Longman [mailto:glongman@gmail.com]
>>>>> Sent: Thursday, February 16, 2006 2:35 PM
>>>>> To: Tapestry users
>>>>> Subject: How do you use Tapestry?
>>>>>
>>>>> Tapestry will install a fake .application file if you don't have one.
>>>>> No physical file but an internal object is created that has a path in
>>>>> the context.
>>>>>
>>>>> How many developers out there using Tapestry 4 depend on this 
>>>>> behaviour?
>>>>>
>>>>> Personally, think it would be useful for someone learning how to use
>>>>> the framework but I come from the old days when the .application was
>>>>> mandatory. I always use one by habit so this feature of Tapestry is
>>>>> not a biggie for me.
>>>>>
>>>>> I'm curious as to how many people are building apps with Tapestry 4,
>>>>> large or small, and don't have a .application file.
>>>>>
>>>>> Geoff
>>>>>
>>>>> -- 
>>>>> The Spindle guy.          http://spindle.sf.net
>>>>> Get help with Spindle:
>>>>> http://lists.sourceforge.net/mailman/listinfo/spindle-user
>>>>> Blog:                     http://jroller.com/page/glongman
>>>>> Feature Updates:          http://spindle.sf.net/updates
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: 
>>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you use Tapestry? - forcing the locale

Posted by Ron Piterman <rp...@gmx.net>.
made sure tapestry *really* uses your engine's class?
ron

Martin Carel wrote:
> Speaking of which, I have this in my application file:
> 
> <meta key="org.apache.tapestry.accepted-locales" value="en" />
> 
> 
> And I do have a custom Engine in which I have:
> 
> public void setLocale(Locale locale) {
>        if (getLocale() == null) {
>    super.setLocale(Locale.ENGLISH);
>  } else {
>    super.setLocale(locale);
>  }       }
> 
> And still, for the fields having a Required validator (in a form with 
> clientValidationEnabled="true"), I do have validation error messages in 
> Swedish (client machine's regional options are set for Sweden), although 
> I would expect them to be in English.
> 
> I also tried to put setLocale(Locale.English) in my Engine's 
> constructor, or have:
> 
> public void setLocale(Locale locale) {
>    super.setLocale(Locale.ENGLISH);
> }
> 
> 
> Still, validation error messages in Swedish!
> 
> Any idea why?
> 
> /M
> 
> Raul Raja Martinez wrote:
> 
>> I, as an example, have to force locales, How would I go for doing so 
>> with no .application file?
>>
>>
>> Patrick Casey wrote:
>>
>>>     I have a .application file. Personally this strikes me as one of
>>> those behaviors which seem newbie friendly (see, you can start it up 
>>> without
>>> having to make a .application file!) but really aren't (the 
>>> documentation
>>> keeps talking about the .application file, but I don't seem to *have* 
>>> one!
>>> What's going on!).
>>>
>>>     I'm sure somewhere, somebody is dependent on the functionality
>>> though :).
>>>
>>>     --- Pat
>>>
>>>> -----Original Message-----
>>>> From: Geoff Longman [mailto:glongman@gmail.com]
>>>> Sent: Thursday, February 16, 2006 2:35 PM
>>>> To: Tapestry users
>>>> Subject: How do you use Tapestry?
>>>>
>>>> Tapestry will install a fake .application file if you don't have one.
>>>> No physical file but an internal object is created that has a path in
>>>> the context.
>>>>
>>>> How many developers out there using Tapestry 4 depend on this 
>>>> behaviour?
>>>>
>>>> Personally, think it would be useful for someone learning how to use
>>>> the framework but I come from the old days when the .application was
>>>> mandatory. I always use one by habit so this feature of Tapestry is
>>>> not a biggie for me.
>>>>
>>>> I'm curious as to how many people are building apps with Tapestry 4,
>>>> large or small, and don't have a .application file.
>>>>
>>>> Geoff
>>>>
>>>> -- 
>>>> The Spindle guy.          http://spindle.sf.net
>>>> Get help with Spindle:
>>>> http://lists.sourceforge.net/mailman/listinfo/spindle-user
>>>> Blog:                     http://jroller.com/page/glongman
>>>> Feature Updates:          http://spindle.sf.net/updates
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org