Thank you Evgeny for the quick response.
I did as u told me and everything worked as expected.
Now I can build a
LocalizableMessage message = new LocalizableMessage("msg");
and see the correct string rendered in <stripes:messages /> tag accordingly
to the navigationLanguage associated to a User.
I have now another problem related to my project.
Im building a CMS, so in some areas of the thin client the text must be
rendered in the navigationLanguage selected (the language of the page given
by the LocalePicker), while in the GUI the text must be rendered in the
editorLanguage choosen by the operator. In other words an editor can edit a
japanese page but the GUI still works in german.
The problem is that <stripes:messages /> reads the Locale given by my
LocalePicker, and cant distinguish from the page and the GUI. Is there any
way to instruct the <stripes:messages /> to use another language?
I could build a new custom tag <mycustomtag:messages lang="de" /> that does
the same operation of <stripes:messages /> with the ability to receive a
parameter to force the language, but I was wandering if there is a cleaner
way to achieve my goal
thank u again
Mirko
Evgeny Shepelyuk-2 wrote:
>
> Hello,
>
> As i understood probabaly you need to implement own LocalePicker and then
> register it in your web.xml.
> This is sample code
>
>
> public class MyLocalePicker implements LocalePicker {
>
> public Locale pickLocale(HttpServletRequest request) {
> //here goes your code to detect locale based on cookie, session, request
> parameters etc etc
> return ...;
> }
>
> public String pickCharacterEncoding(HttpServletRequest request, Locale
> locale) {
> return "UTF-8";
> }
>
> public void init(Configuration configuration) throws Exception {
> }
> }
>
>>
>> Hi everyone,
>> its a noob question but something is getting me out of the correct path.
>>
>> I need to internationalize a page, the user will see an English or German
>> phrase according to the language choosen by clicking a flag: he clicks a
>> flag, my UserData bean fills its "choosenlocale" field with the selected
>> Locale and the jsp renders itself in the correct language... beautiful
>> but
>> it doesnt work.
>>
>> The problem is that Stripes tags pick the locale in this way:
>> Locale locale = getPageContext().getRequest().getLocale();
>> (line 250 of InputTagSupport.java) - regardless of the Locale stored in
>> my
>> UserData bean.
>>
>> Now, i know that it is something about LocalePicker, but i cant really
>> understand what to do to with this.
>>
>> I wrote this in web.xml
>>
>> <init-param>
>> <param-name>LocalePicker.Locales</param-name>
>> <param-value>en,de</param-value>
>> </init-param>
>>
>> and then hoped to get my bundles (StripesResources.properties and
>> StripesResources_de.properties) work... nothing changes, English shown
>> everytime since my browser sends "en" as lang...
>>
>> please help me
>> ty in advance
>>
>> mirko
>>
>>
>>
>>
>>
>>
>
>
> --
> Regards,
> Evgeny Shepelyuk
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
--
View this message in context:
http://old.nabble.com/Problem-with-Internationalization-of-StripesResources-tp26377435p26388476.html
Sent from the stripes-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users