Return locale-aware formatted string
@return string
12934
function format() {
		$args=func_get_args();
		$val=array_shift($args);
		// Get formatting rules
		$conv=localeconv();
		return preg_replace_callback(
			'/\{(?P<pos>\d+)\s*(?:,\s*(?P<type>\w+)\s*'.
			'(?:,\s*(?P<mod>(?:\w+(?:\s*\{.+?\}\s*,?)?)*)'.
			'(?:,\s*(?P<prop>.+?))?)?)?\}/',
			function($expr) use($args,$conv) {
				extract($expr);
				extract($conv);
				if (!array_key_exists($pos,$args))
					return $expr[0];
				if (isset($type))
					switch ($type) {
						case 'plural':
							preg_match_all('/(?<tag>\w+)'.
								'(?:\s*\{\s*(?<data>.+?)\s*\})/',
								$mod,$matches,PREG_SET_ORDER);
							$ord=array('zero','one','two');
							foreach ($matches as $match) {
								extract($match);
								if (isset($ord[$args[$pos]]) &&
									$tag==$ord[$args[$pos]] || $tag=='other')
									return str_replace('#',$args[$pos],$data);
							}
						case 'number':
							if (isset($mod))
								switch ($mod) {
									case 'integer':
										return number_format(
											$args[$pos],0,'',$thousands_sep);
									case 'currency':
										if (function_exists('money_format'))
											return money_format(
												'%n',$args[$pos]);
										$fmt=array(
											0=>'(nc)',1=>'(n c)',
											2=>'(nc)',10=>'+nc',
											11=>'+n c',12=>'+ nc',
											20=>'nc+',21=>'n c+',
											22=>'nc +',30=>'n+c',
											31=>'n +c',32=>'n+ c',
											40=>'nc+',41=>'n c+',
											42=>'nc +',100=>'(cn)',
											101=>'(c n)',102=>'(cn)',
											110=>'+cn',111=>'+c n',
											112=>'+ cn',120=>'cn+',
											121=>'c n+',122=>'cn +',
											130=>'+cn',131=>'+c n',
											132=>'+ cn',140=>'c+n',
											141=>'c+ n',142=>'c +n'
										);
										if ($args[$pos]<0) {
											$sgn=$negative_sign;
											$pre='n';
										}
										else {
											$sgn=$positive_sign;
											$pre='p';
										}
										return str_replace(
											array('+','n','c'),
											array($sgn,number_format(
												abs($args[$pos]),
												$frac_digits,
												$decimal_point,
												$thousands_sep),
												$currency_symbol),
											$fmt[(int)(
												(${$pre.'_cs_precedes'}%2).
												(${$pre.'_sign_posn'}%5).
												(${$pre.'_sep_by_space'}%3)
											)]
										);
									case 'percent':
										return number_format(
											$args[$pos]*100,0,$decimal_point,
											$thousands_sep).'%';
									case 'decimal':
										return number_format(
											$args[$pos],$prop,$decimal_point,
												$thousands_sep);
								}
							break;
						case 'date':
							if (empty($mod) || $mod=='short')
								$prop='%x';
							elseif ($mod=='long')
								$prop='%A, %d %B %Y';
							return strftime($prop,$args[$pos]);
						case 'time':
							if (empty($mod) || $mod=='short')
								$prop='%X';
							return strftime($prop,$args[$pos]);
						default:
							return $expr[0];
					}
				return $args[$pos];
			},
			$val
		);
	}
556887
public static function getLocales()
    {
        $localeDir     = __DIR__.'/../locales';
        $languageFiles = scandir($localeDir);
        $locales       = [];
        foreach ($languageFiles as $languageFile) {
            if (in_array($languageFile, ['.', '..'])) {
                continue;
            }
            $extensionPos = strpos($languageFile, '.yml');
            if ($extensionPos !== false) {
                $locale    = substr($languageFile, 0, $extensionPos);
                $locales[] = $locale;
            }
        }
        sort($locales);
        return $locales;
    }
1099820
public function format()
    {
        return sprintf(
            '%s %s %s',
            $this->getCountryCode() . $this->getChecksum(),
            substr($this->getInstituteIdentification(), 0, 4),
            implode(' ', str_split($this->getBankAccountNumber(), 4))
        );
    }
406560
public function key()
    {
        if ( ! $this->isTranslated()) {
            return $this->key;
        }

        $parts = explode('.', $this->key);

        array_splice($parts, $this->localeIndex, 0, $this->getLocalePlaceholder());

        return trim(implode('.', $parts), '.');
    }
169693
public function getTimeFormat()
    {
        if ($this->getHTML5()) {
            // Browsers expect ISO 8601 times, localisation is handled on the client
            $this->setTimeFormat(DBTime::ISO_TIME);
        }

        if ($this->timeFormat) {
            return $this->timeFormat;
        }

        // Get from locale
        return $this->getFrontendFormatter()->getPattern();
    }
640019
public static function getLocale()
    {
        if (empty(self::$locale)) {
            self::$locale = new StringType(\locale_get_default());
        }

        return self::$locale;
    }
321584
protected function formatter()
    {
        $key = $this->getLocalesKey(
            $locale = $this->getLocale(),
            $fallbackLocale = $this->getFallbackLocale()
        );

        if (! isset($this->formatters[$key])) {
            $this->formatters[$key] = new CurrencyFormatter(
                new NumberFormatRepository($fallbackLocale),
                $this->data(),
                ['locale' => $locale]
            );
        }

        return $this->formatters[$key];
    }
273694
public function getLocale()
    {
        if (null !== ($request = $this->getMasterRequest())) {
            $locale = $request->get('_locale');
        }

        if (!isset($locale)) {
            $locale = $this->fallback_locale;
        }

        return $locale;
    }
739913
protected function findLocale()
    {
        $locale = null;

        if (PHP_SAPI == 'cli') {
            $locale = getenv('LANG');
        } else if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && extension_loaded('intl')) {
            $locale = \Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
        }

        return $locale;
    }
72776
protected function localeSequence()
    {
        if ($this->localeSequence) {
            return $this->localeSequence;
        }

        if ($this->localeFallbacks) {
            $this->localeSequence = $this->localeFallbacks;
        }

        if (!$this->locale) {
            return $this->localeSequence;
        }

        if (!strpos($this->locale, '_') ) {
            array_unshift($this->localeSequence, $this->locale);
            return $this->localeSequence;
        }

        $base = explode('_', $this->locale, 2)[0];

        array_unshift($this->localeSequence, $base);
        array_unshift($this->localeSequence, $this->locale);

        return $this->localeSequence;
    }
1274735
public function getLocale()
	{
        $locales = explode(',', $this->_meta->locale);

		for($i = 0; $i < count($locales); $i++ ) {
			$locale = $locales[$i];
			$locale = trim($locale);
			$locales[$i] = $locale;
		}

		return $locales;
	}
1172100
public function ToString()
	{
		$result = $this->LocalName;

		if ( ! empty( $this->Prefix ) )
		{
		    $result = $this->Prefix . ':' . $result;
		}
		return $result;
	}
1222199
public function getLocale() : ?string 
    {
        if ( ! $this->hasLocale()) {
            $this->setLocale($this->getDefaultLocale());
        }
        return $this->locale;
    }
70691
public String getDescriptiveText() {
        String defaultLocale = Locale.getDefault().getLanguage();
        String descriptiveText = getDescriptiveText(defaultLocale);
        if (descriptiveText == null) {
            descriptiveText = getDescriptiveText("en");
            if (descriptiveText == null) {
                descriptiveText = getDescriptiveText("");
            }
        }
        return descriptiveText;
    }
1274091
private function _getFormat(){
        $format = '';
        switch(strtoupper($this->format)){
            case 'PNG':
                $format = CINDrawing::IMG_FORMAT_PNG;
                break;
            case 'JPEG':
                $format = CINDrawing::IMG_FORMAT_JPEG;
                break;
            case 'GIF':
                $format = CINDrawing::IMG_FORMAT_GIF;
                break;
            case 'WBMP':
                $format = CINDrawing::IMG_FORMAT_WBMP;
                break;
            default:
                $format = CINDrawing::IMG_FORMAT_PNG;
                break;
        }
        return $format;
    }
1331216
static function fetchLocaleList()
    {
        $languages = eZContentLanguage::fetchList();
        $localeList = array();

        foreach ( $languages as $language )
        {
            $localeList[] = $language->attribute( 'locale' );
        }

        return $localeList;
    }
210926
public function getFormattedString()
    {
        $string = (string) $this->code;

        if (null !== $this->message) {
            $string = $string . ' ' . $this->message;
        }

        return $string;
    }