src/Utilities/Locale.php
public static function getLongForm($languageCode, $countryCode = '', $encoding = 'UTF-8')
    {
        if (is_string($languageCode)) {
            $languageCode = trim($languageCode);
        }

        /*
         * Language code not provided?
         * Nothing to do
         */
        if (empty($languageCode)) {
            return '';
        }

        /*
         * Country code not provided?
         * Let's use language code
         */
        if (empty($countryCode)) {
            $countryCode = $languageCode;
        }

        if (!empty($encoding)) {
            $encoding = sprintf('.%s', $encoding);
        }

        return sprintf('%s_%s%s', $languageCode, strtoupper($countryCode), $encoding);
    }
public static function getLongForm($languageCode, $countryCode = '', $encoding = 'UTF-8')
    {
        if (is_string($languageCode)) {
            $languageCode = trim($languageCode);
        }

        /*
         * Language code not provided?
         * Nothing to do
         */
        if (empty($languageCode)) {
            return '';
        }

        /*
         * Country code not provided?
         * Let's use language code
         */
        if (empty($countryCode)) {
            $countryCode = $languageCode;
        }

        if (!empty($encoding)) {
            $encoding = sprintf('.%s', $encoding);
        }

        return sprintf('%s_%s%s', $languageCode, strtoupper($countryCode), $encoding);
    }
public static function getLongForm ( $ languageCode , $ countryCode = '' , $ encoding = 'UTF-8' ) { if ( is_string ( $ languageCode ) ) { $ languageCode = trim ( $ languageCode ) ; } /*
         * Language code not provided?
         * Nothing to do
         */ if ( empty ( $ languageCode ) ) { return '' ; } /*
         * Country code not provided?
         * Let's use language code
         */ if ( empty ( $ countryCode ) ) { $ countryCode = $ languageCode ; } if ( ! empty ( $ encoding ) ) { $ encoding = sprintf ( '.%s' , $ encoding ) ; } return sprintf ( '%s_%s%s' , $ languageCode , strtoupper ( $ countryCode ) , $ encoding ) ; }
Returns long form of the locale

@param string $languageCode Language code, in ISO 639-1 format. Short form of the locale, e.g. "fr".
@param string $countryCode  (optional) Country code, in ISO 3166-1 alpha-2 format, e.g. "FR"
@param string $encoding     (optional) Encoding of the final locale
@return string

Example:
- language code: fr
- country code: ''
- result: fr_FR
Returns long form of the locale