Java tutorial
//package com.java2s; import java.util.Locale; public class Main { public static String getLocaleLanguage() { Locale l = Locale.getDefault(); return String.format("%s-%s", l.getLanguage(), l.getCountry()); } }