@ Override public String asString ( Object object ) { // at this point object is guaranteed to be a Locale instance Locale locale = ( Locale ) object ; StringBuilder builder = new StringBuilder ( 5 ) ; builder . append ( locale . getLanguage ( ) ) ; builder . append ( ' ' ) ; builder . append ( locale . getCountry ( ) ) ; return builder . toString ( ) ; }
Return locale instance ISO - 639 language and ISO - 3166 country code for example en - US .