If `$locale` is invalid, the return value is actually the value of `$locale`, not `NULL` or `FALSE` as you might expect.
(If `$in_locale` is invalid, but `$locale` is valid, the return value is the language name in the default locale.)
(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)
Locale::getDisplayLanguage -- locale_get_display_language — Girdi yerelindeki anadil kodunun yerelleştirilmiş ismini döndürür
Nesne yönelimli kullanım
$dil_yereli
, string $adlandırma_yereli
= ?): stringYordamsal kullanım
$dil_yereli
, string $adlandırma_yereli
= ?): string
Girdi yerelindeki anadil kodunun yerelleştirilmiş ismini döndürür.
Öntanımlı yerel kullanılmışsa null
döner.
dil_yereli
Anadil adı döndürülecek yerel.
adlandırma_yereli
İsteğe bağlı olarak anadil isminin gösteriminde kullanılacak yerel.
hedef_yerel
ile belirtilen yerelin anadil kodunun
adlandırma_yereli
ile belirtilen yereldeki ismini
döndürür.
Örnek 1 - locale_get_display_language() örneği
<?php
echo locale_get_display_language('sl-Latn-IT-nedis', 'en');
echo ";\n";
echo locale_get_display_language('sl-Latn-IT-nedis', 'fr');
echo ";\n";
echo locale_get_display_language('sl-Latn-IT-nedis', 'tr');
?>
Örnek 2 - Nesne yönelimli kullanım örneği
<?php
echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'en');
echo ";\n";
echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'fr');
echo ";\n";
echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'tr');
?>
Yukarıdaki örneğin çıktısı:
Slovenian; slovène; Slovence
If `$locale` is invalid, the return value is actually the value of `$locale`, not `NULL` or `FALSE` as you might expect.
(If `$in_locale` is invalid, but `$locale` is valid, the return value is the language name in the default locale.)
To display special characters correctly in a web browser, it's a good idea to decode the result data with utf8_decode:
<?php
echo utf8_decode(Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'fr'));
echo utf8_decode(Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'pt-BR'));
?>