Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24556

Re: Where did my language setting go?

From markspace <markspace@nospam.nospam>
Newsgroups comp.lang.java.programmer
Subject Re: Where did my language setting go?
Date 2013-07-01 13:37 -0700
Organization A noiseless patient Spider
Message-ID <kqsovn$1t1$1@dont-email.me> (permalink)
References <hbd3t8prm69278clpjolii23cuortojbn7@4ax.com> <p7i3t89561o32oj1kaejfdq7ib78e8oolt@4ax.com> <kqsjra$odd$1@dont-email.me> <tho3t8houvs8urtv080j4g9dv7cci4ln34@4ax.com>

Show all headers | View raw


On 7/1/2013 1:13 PM, Tim Slattery wrote:
> markspace <markspace@nospam.nospam> wrote:
>
>
>> I'm kind of confused why it would do this.  I don't really know about
>> Struts or even JEE every much, so I'm probably missing something, but
>> getLocale() on HttpServletRequest should return the locale requested by
>> the browser (client).  Then you should just be able to do this:
>>
>> ResourceBundle labels = ResourceBundle.getBundle("ces", locale);
>
> You're probably right. I should check out just doing <fmt:setBundle
> basename="ces"/> and see if would get the language suffix from the
> Locale that's been set. I don't think it's very likely that this app
> will get any more languages, but even so it would clean up the code a
> lot.
>


I did a quick web search for "struts fmt setbundle" and found this example.


<fmt:setLocale value="en"/>
<fmt:setBundle basename="com.tutorialspoint.Example" var="lang"/>

<fmt:message key="count.one" bundle="${lang}"/><br/>

So a "setLocale" might be required as well.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Where did my language setting go? Tim Slattery <Slattery_T@bls.gov> - 2013-07-01 12:59 -0400
  Re: Where did my language setting go? Tim Slattery <Slattery_T@bls.gov> - 2013-07-01 14:30 -0400
    Re: Where did my language setting go? markspace <markspace@nospam.nospam> - 2013-07-01 12:09 -0700
      Re: Where did my language setting go? Tim Slattery <Slattery_T@bls.gov> - 2013-07-01 16:13 -0400
        Re: Where did my language setting go? markspace <markspace@nospam.nospam> - 2013-07-01 13:37 -0700

csiph-web