You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "francois@rendezvouscentral.com" <fr...@rendezvouscentral.com> on 2011/03/30 00:26:23 UTC

getText

Hi Everybody
is there a way to use getText in an action and specify the locale (I mean ,
I don't want struts to use the getLocale() from the browser) ?

something like that getText('my.ref',myLocale);

thx a lot

--
View this message in context: http://struts.1045723.n5.nabble.com/getText-tp4270294p4270294.html
Sent from the Struts - User mailing list archive at Nabble.com.

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


RE: getText

Posted by Jose Luis Martinez Avial <jl...@pb-santander.com>.
You can setup a locale in the session and Struts will use that for all
your texts. 

-----Original Message-----
From: francois@rendezvouscentral.com
[mailto:francois@rendezvouscentral.com] 
Sent: Tuesday, March 29, 2011 6:26 PM
To: user@struts.apache.org
Subject: getText

Hi Everybody
is there a way to use getText in an action and specify the locale (I
mean , I don't want struts to use the getLocale() from the browser) ?

something like that getText('my.ref',myLocale);

thx a lot

--
View this message in context:
http://struts.1045723.n5.nabble.com/getText-tp4270294p4270294.html
Sent from the Struts - User mailing list archive at Nabble.com.

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


Internet communications are not secure and therefore Banco 
Santander International does not accept legal responsibility for 
the contents of this message. Any views or opinions presented 
are solely those of the author and do not necessarily represent 
those of Banco Santander International unless otherwise 
specifically stated. 

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal 
ni de ning'un otro tipo por el contenido de este mensaje. 
Cualquier opini'on transmitida pertenece 'unicamente al autor y 
no necesariamente representa la opini'on de Banco Santander 
International, a no ser que est'e expresamente detallado.

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


RE: getText

Posted by "francois@rendezvouscentral.com" <fr...@rendezvouscentral.com>.
thx a lot it seems to be exactly what I need Francois Rouxel www.rendezvouscentral.com 


-------- Original Message -------- 
Subject: Re: getText 
From: Okan_Özeren_[via_Struts] 
&lt; ml-node+4271219-775331120-194886@n5.nabble.com &gt; 
Date: Wed, March 30, 2011 6:40 am 
To: " francois@rendezvouscentral.com " &lt; francois@rendezvouscentral.com &gt; 

 Hi, Sometimes I use this method for getting a value of key from multilanguage resource bundles with localized which I want. Below method is into the *LocalizedTextUtil* class &nbsp;and * com.opensymphony.xwork2.util* package and *xwork-core-*.jar* which library you need as struts2 libraries depended. &nbsp; &nbsp;/** &nbsp; &nbsp; * Returns a localized message for the specified key, aTextName. &nbsp;Neither the key nor the &nbsp; &nbsp; * message is evaluated. &nbsp; &nbsp; * &nbsp; &nbsp; * @param aTextName the message key &nbsp; &nbsp; * @param locale &nbsp; &nbsp;the locale the message should be for &nbsp; &nbsp; * @return a localized message based on the specified key, or null if no localized message can be found for it &nbsp; &nbsp; */ &nbsp; &nbsp;public static String findDefaultText(String aTextName, Locale locale); I hope this is usefull for you, Okan Özeren. On Wed, Mar 30, 2011 at 1:26 AM, [hidden email]  &lt; [hidden email] &gt; wrote: &gt; Hi Everybody &gt; is there a way to use getText in an action and specify the locale (I mean , &gt; I don't want struts to use the getLocale() from the browser) ? &gt; &gt; something like that getText('my.ref',myLocale); &gt; &gt; thx a lot &gt; &gt; -- &gt; View this message in context: http://struts.1045723.n5.nabble.com/getText-tp4270294p4270294.html &gt; Sent from the Struts - User mailing list archive at Nabble.com . &gt; &gt; --------------------------------------------------------------------- &gt; To unsubscribe, e-mail: [hidden email]  &gt; For additional commands, e-mail: [hidden email]  &gt; &gt;      If you reply to this email, your message will be added to the discussion below:  http://struts.1045723.n5.nabble.com/getText-tp4270294p4271219.html    To unsubscribe from Struts, click here . 



--
View this message in context: http://struts.1045723.n5.nabble.com/getText-tp4270294p4271312.html
Sent from the Struts - User mailing list archive at Nabble.com.

Re: getText

Posted by Okan Özeren <ok...@gmail.com>.
Hi,

Sometimes I use this method for getting a value of key from multilanguage
resource bundles with localized which I want.

Below method is into the *LocalizedTextUtil* class  and *
com.opensymphony.xwork2.util* package and *xwork-core-*.jar* which library
you need as struts2 libraries depended.

   /**
    * Returns a localized message for the specified key, aTextName.  Neither
the key nor the
    * message is evaluated.
    *
    * @param aTextName the message key
    * @param locale    the locale the message should be for
    * @return a localized message based on the specified key, or null if no
localized message can be found for it
    */
   public static String findDefaultText(String aTextName, Locale locale);

I hope this is usefull for you,

Okan Özeren.

On Wed, Mar 30, 2011 at 1:26 AM, francois@rendezvouscentral.com <
francois@rendezvouscentral.com> wrote:
> Hi Everybody
> is there a way to use getText in an action and specify the locale (I mean
,
> I don't want struts to use the getLocale() from the browser) ?
>
> something like that getText('my.ref',myLocale);
>
> thx a lot
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/getText-tp4270294p4270294.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>