• Welcome to KonaKart Community Forum. Please login or sign up.
 

Message Resource not loading for the first time browser

Started by Sony George, December 04, 2009, 07:14:13 pm

Previous topic - Next topic

Sony George

Hello,


I created a message resource for my language and set it as the default language in admin app,
also created message resource in konakart.
then in IE-->Tools-->Internet Options-->General -->Languages Button i added my language and moved
my language to top and browsed konakart app
but the English locale is showing by struts, but if i do it by SetLocale action, it works fine

i did this test for http://www.konakart.com/konakart/
ie: i added Germen [de] and Germen (Germeny) [de-DE] to top of IE-->Tools-->Internet Options-->General -->Languages
and browsed http://www.konakart.com/konakart/ ,but the app did not show the German language but the English language

usually, the struts app should automatically select the message resource according to the client locale
but this does not happen to konakart, is there any specific reason to prevent this, or any bug ??

regards

Sony

Sony George

hello,

always for the first time ie: before manually calling setLocalAction, the konakart engine set locale as wrong
for example if we print <%=kkAppEng.getLocale%> the value returned is en_EN, or if we set
German as the default language in the admin app then
de_DE is returned, and of course there is no locale like that.
i think, in the table languages for the code column, only 2 char is supported
and konakart is setting up the locale as

new Locale("languages.code","languages.code");
In BaseAction.java the following code would not work
line no 103

            String locale = kkAppEng.getLocale();
            if (locale != null)
            {
                String[] codes = locale.split("_");
                // Set the currrent locale so that it's picked up by Struts
                setLocale(request, new Locale(codes[0], codes[1]));
            }

because locale value is de_DE and there is no resource file Mesage_de_DE.properties in the app
so for the first time default language is not picked up by struts application