public List < LocaleBean > getLocales ( Locale currentLocale ) { List < LocaleBean > locales = new ArrayList <> ( ) ; // get the array of locales available from the portal List < Locale > portalLocales = localeManagerFactory . getPortalLocales ( ) ; for ( Locale locale : portalLocales ) { if ( currentLocale != null ) { // if a current locale is available, display language names // using the current locale locales . add ( new LocaleBean ( locale , currentLocale ) ) ; } else { locales . add ( new LocaleBean ( locale ) ) ; } } return locales ; }
Return a list of LocaleBeans matching the currently available locales for the portal .