Java Hindi locale support? -


i using java6 web application trying below code change laguage of application

public static void dochangelanguage(string arglang) {         sessionvalidationinitiator.setlanguage(arglang);         logger.debug("changing language ... " + arglang);         if(arglang.equalsignorecase("fr_ca")){         locales.setthreadlocal(locales.getlocale(locale.french));         executions.getcurrent().getsession().setattribute(attributes.preferred_locale, locale.french);         labels.reset();         }else{             locales.setthreadlocal(locales.getlocale(locale.us));             executions.getcurrent().getsession().setattribute(attributes.preferred_locale, locale.us);             labels.reset();         }         executions.sendredirect(null);     } 

its working fine when trying change hindi saw no locale indian language.

can support hindi locale java application work hindi language.

java 6 has hindi locale support, refer here

to explicitly set locale hindi, india this:

system.out.println(new locale("hi", "in")); 

prints;

hi_in 

the thing note here locale offer constructors accurately handle on supported locale(s) , variants.

hence, in code might want try out:

 locales.setthreadlocal(locales.getlocale(new locale("hi", "in"))); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -