src/Sulu/Component/Localization/Localization.php
public function getLocale($format = self::UNDERSCORE)
    {
        $localization = strtolower($this->getLanguage());

        if (null != $this->getCountry()) {
            $country = strtolower($this->getCountry());
            $delimiter = '-';

            switch ($format) {
                case self::UNDERSCORE:
                    $delimiter = '_';
                    break;
                case self::ISO6391:
                    $country = strtoupper($country);
                    break;
                case self::LCID:
                    $delimiter = '_';
                    $country = strtoupper($country);
                    break;
            }

            $localization .= $delimiter . $country;
        }

        return $localization;
    }
public function getLocale($format = self::UNDERSCORE)
    {
        $localization = strtolower($this->getLanguage());

        if (null != $this->getCountry()) {
            $country = strtolower($this->getCountry());
            $delimiter = '-';

            switch ($format) {
                case self::UNDERSCORE:
                    $delimiter = '_';
                    break;
                case self::ISO6391:
                    $country = strtoupper($country);
                    break;
                case self::LCID:
                    $delimiter = '_';
                    $country = strtoupper($country);
                    break;
            }

            $localization .= $delimiter . $country;
        }

        return $localization;
    }
public function getLocale ( $ format = self :: UNDERSCORE ) { $ localization = strtolower ( $ this -> getLanguage ( ) ) ; if ( null != $ this -> getCountry ( ) ) { $ country = strtolower ( $ this -> getCountry ( ) ) ; $ delimiter = '-' ; switch ( $ format ) { case self :: UNDERSCORE : $ delimiter = '_' ; break ; case self :: ISO6391 : $ country = strtoupper ( $ country ) ; break ; case self :: LCID : $ delimiter = '_' ; $ country = strtoupper ( $ country ) ; break ; } $ localization .= $ delimiter . $ country ; } return $ localization ; }
Returns the localization code, which is a combination of the language and the country in a specific format.

@param string $format requested localization format

@return string
@VirtualProperty
Returns the localization code which is a combination of the language and the country in a specific format .