Note that there are some explanatory texts on larger screens.

plurals
  1. POjava web localization support
    primarykey
    data
    text
    <p>i have already created localized .properties files. but i have no idea how to change them on the fly. Thing is i can make a form selector for language but where should i point the output to set? It always uses the default .properties file</p> <p>my form looks like this</p> <pre><code>&lt;h:form&gt; &lt;h:selectOneMenu id="language" value="????"&gt; &lt;f:selectItem id="item1" itemLabel="Czech" itemValue="cs_CZ" /&gt; &lt;f:selectItem id="item2" itemLabel="Slovak" itemValue="sk_SK" /&gt; &lt;f:selectItem id="item3" itemLabel="English" itemValue="default" /&gt; &lt;/h:selectOneMenu&gt; &lt;/h:form&gt; </code></pre> <p>i am using spring with hibernate JSF2.0 and J2EE1.6</p> <p>Thanks</p> <p>UPDATE: </p> <p>i loaded the bundle like:</p> <pre><code> &lt;f:loadBundle basename="bundle/labels" var="labels"/&gt; </code></pre> <p>but i need to replace it with:</p> <pre><code>&lt;bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"&gt; &lt;property name="basenames"&gt; &lt;list&gt; &lt;value&gt;Messages&lt;/value&gt; &lt;value&gt;labels&lt;/value&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>but this solutions wont find the labels.properties in package bundle. it looks for in classpath but i cant relocate it.</p> <p>UPDATE 2:</p> <p>ok now i can see JSF and SPRING has different loading methods, while SPRING takes bundles from messageSource JSF still takes them from <code>&lt;f:loadBundle&gt;</code> so how do i make <code>&lt;f:loadBundle&gt;</code> to take translated properties?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload