public static String calculateLanguage(Locale locale) {
        return locale.getLanguage();
    }
Gets ISO 639-1 Language Code from Locale so 'pt_BR' becomes 'pt'.

@param locale the Locale to calculate the language for
@return the ISO 639-1 Language Code
primefaces/src/main/java/org/primefaces/util/LocaleUtils.java