Locale: Language name to Country / Language code
问题 EDIT: I have a language name in English, nothing else. How do I get the code for it. e.g.: English -> en German -> de Spanish -> es Chinese -> zh 回答1: We have to set the Language name and country name for locale to get this // Locale(String language, String country) Locale locale = new Locale("German" , "DE"); // print ISO3 country name for corresponding locale System.out.println("Name:" + locale.getISO3Country()); This returns ISO3Country name as DEU 回答2: LanguageCode enum contained in com