Code in previous post was incomplete, here is the complete one.

    377             // If nothing is right we will endup with en_US locale.
    378             Locale preferedLocale = Locale.US;
    379             for (Enumeration e = req.getLocales();e.hasMoreElements();)
    380             {
    381                Locale requestedLocale = (Locale)e.nextElement();
    382                ResourceBundle requestedResourceBundle = getResourceBundl       
 e(requestedLocale);
    383
    384                // If there is an exact match, return it
    385                if (requestedResourceBundle.getLocale().equals(requestedL       
 ocale))
    386                {
    387                    preferedLocale = requestLocale;
    388                    break;
    389                }
    390                // Ensure we do not return the bundle for default locale
        of JVM
    391                // when mismatch occur
    392                if (requestedResourceBundle.getLocale().equals(Locale.get       
 Default()))
    393                {
    394                    continue;
    395                }
    396                // It returns Locale.US if tmpLocale is not supported
    397                if (!requestedResourceBundle.getLocale().equals(Locale.US       
 ))
    398                {
    399                   preferedLocale = requestedLocale;
    400                   break;
    401                }


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3829351#3829351

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3829351


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to