public static String getLocalDisplayName ( String locale ) { String desc = "" + locale ; if ( locale != null ) { String [ ] langArray = locale . split ( "_" ) ; Locale loc = null ; if ( langArray . length == 1 ) { loc = new Locale ( langArray [ 0 ] ) ; } else if ( langArray . length == 2 ) { loc = new Locale ( langArray [ 0 ] , langArray [ 1 ] ) ; } else if ( langArray . length == 3 ) { loc = new Locale ( langArray [ 0 ] , langArray [ 1 ] , langArray [ 2 ] ) ; } if ( loc != null ) { desc = loc . getDisplayLanguage ( loc ) ; } } return desc ; }
Gets the name of the language of and for the given locale .