You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stephen Ince <st...@gmail.com> on 2010/03/24 10:01:44 UTC

retrieve i18n application messages.

Does anyone know how to programmatically retrieve the i18n messages outside 
the context of an action class.
I know with the action you can call getText.
I need similiar functionality. I have access to the http request headers. I 
assume I need the accept language request header.

e.g.
String acceptLanguageHdr = "english";
String msg = "my.value";
// api call to get the correct i18n message similiar to getText.
getText(msg);


Any help would be appreciated.

Steve


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


Re: retrieve i18n application messages.

Posted by Stephen Ince <st...@gmail.com>.
Stan,
  Thx for your response. I was under the assumption that struts had a search 
pattern for resource bundles and I wanted to use the same search pattern, or 
at least leverage their api.

Steve
----- Original Message ----- 
From: <st...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 24, 2010 7:12 AM
Subject: Re: retrieve i18n application messages.


> S2 doesn't do anything special.  It leverages the native Java resource
> bundles and locale.  I would advise you to begin by looking at the Locale
> class.
>
>
> On Wed, Mar 24, 2010 at 4:01 AM, Stephen Ince 
> <st...@gmail.com>wrote:
>
>> Does anyone know how to programmatically retrieve the i18n messages 
>> outside
>> the context of an action class.
>> I know with the action you can call getText.
>> I need similiar functionality. I have access to the http request headers. 
>> I
>> assume I need the accept language request header.
>>
>> e.g.
>> String acceptLanguageHdr = "english";
>> String msg = "my.value";
>> // api call to get the correct i18n message similiar to getText.
>> getText(msg);
>>
>>
>> Any help would be appreciated.
>>
>> Steve
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 


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


Re: retrieve i18n application messages.

Posted by st...@gmail.com.
S2 doesn't do anything special.  It leverages the native Java resource
bundles and locale.  I would advise you to begin by looking at the Locale
class.


On Wed, Mar 24, 2010 at 4:01 AM, Stephen Ince <st...@gmail.com>wrote:

> Does anyone know how to programmatically retrieve the i18n messages outside
> the context of an action class.
> I know with the action you can call getText.
> I need similiar functionality. I have access to the http request headers. I
> assume I need the accept language request header.
>
> e.g.
> String acceptLanguageHdr = "english";
> String msg = "my.value";
> // api call to get the correct i18n message similiar to getText.
> getText(msg);
>
>
> Any help would be appreciated.
>
> Steve
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>