28 May, 2013

Language Label in Native Locale

We have seen in every site with different language transformation section.
So here you would have noticed that every language labels coming into their native locale.
If you want to get language label in native locale in liferay, just use below code in java class or theme to get it work :

In Java Class :



Locale locale = LocaleUtil.fromLanguageId("es_ES");
System.out.println("Language Label : " + locale.getDisplayName(locale));


In portal_normal.vm file :

 $localeUtil.fromLanguageId("es_ES").getDisplayName($localeUtil.fromLanguageId("es_ES"))
 

Popular Posts

Featured Post

Liferay 7.3 compatibility matrix

Compatibility Matrix Liferay's general policy is to test Liferay Portal CE against newer major releases of operating systems, open s...