public static Locale getCurrentLocale(FacesContext context) {
        Locale locale = null;

        if (context != null) {
            UIViewRoot viewRoot = context.getViewRoot();

            // Prefer the locale set in the view.
            if (viewRoot != null) {
                locale = viewRoot.getLocale();
            }

            // Then the client preferred locale.
            if (locale == null) {
                locale = context.getExternalContext().getRequestLocale();
            }

            // Then the Jakarta Faces default locale.
            if (locale == null) {
                locale = context.getApplication().getDefaultLocale();
            }
        }

        // Finally the system default locale.
        if (locale == null) {
            locale = Locale.getDefault();
        }

        return locale;
    }
Some JS libraries like FullCalendar used by Schedule require the locale for "pt_BR" to be "pt-br".

@param locale the Locale to convert
@return the Javascript string locale
primefaces/src/main/java/org/primefaces/util/LocaleUtils.java