本文整理匯總了PHP中Locale::getDisplayScript方法的典型用法代碼示例。如果您正苦於以下問題:PHP Locale::getDisplayScript方法的具體用法?PHP Locale::getDisplayScript怎麽用?PHP Locale::getDisplayScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Locale
的用法示例。
在下文中一共展示了Locale::getDisplayScript方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDisplayScript
/**
* Returns detailed informations from the script table
* If no detail is given a complete table is returned
*
* @param string $locale Normalized locale
* @param boolean $invert Invert output of the data
* @param string|array $detail Detail to return information for
* @return array
*/
public static function getDisplayScript($locale, $invert = false, $detail = null)
{
if ($detail !== null) {
return Locale::getDisplayScript($locale);
} else {
$list = ZFLocale::getLocaleList();
foreach ($list as $key => $value) {
$list[$key] = Locale::getDisplayScript($key);
}
if ($invert) {
array_flip($list);
}
return $list;
}
}
示例2: dispScript
/**
* Returns the script of a locale after localizing it in the default or some other locale.
*
* @param CULocale $inLocale **OPTIONAL. Default is** *the application's default locale*. The locale in which the
* script is to be localized.
*
* @return CUStringObject The locale's localized script.
*/
public function dispScript(CULocale $inLocale = null)
{
$strInLocale = isset($inLocale) ? $inLocale->m_name : self::defaultLocaleName();
return Locale::getDisplayScript($this->m_name, $strInLocale);
}
示例3:
echo Locale::getDisplayRegion($locale, $locale) ?: '<em>none</em>';
?>
</td>
</tr>
<tr>
<th>Script</th>
<td><?php
echo Locale::getScript($locale) ?: '<em>none</em>';
?>
</td>
<td><?php
echo Locale::getDisplayScript($locale, Yii::$app->language) ?: '<em>none</em>';
?>
</td>
<td><?php
echo Locale::getDisplayScript($locale, $locale) ?: '<em>none</em>';
?>
</td>
</tr>
<tr>
<th>Default Currency</th>
<?php
$defaultCurrency = \app\models\NumberFormatterInfo::getDefaultCurrency($locale);
?>
<td><?php
echo $defaultCurrency ? $defaultCurrency . ' (' . \app\models\NumberFormatterInfo::getDefaultCurrencySymbol($locale) . ')' : '<em>none</em>';
?>
</td>
<td><?php
echo $defaultCurrency ? ResourceInfo::getCurrencyName($defaultCurrency, Yii::$app->language) : '<em>none</em>';
?>
示例4: getDisplayScript
/**
* Returns an appropriately localized display name for script of the locale
*
* @param string $inLocale Optional format locale to use to display the script name
* @return string Name of the script in the format appropriate for $inLocale.
*/
public function getDisplayScript($inLocale = '')
{
if (!$inLocale) {
$inLocale = $this->getLocale();
}
return IntlLocale::getDisplayScript($this->getLocale(), $inLocale);
}
示例5: getDisplayScript
/**
* Returns a name for the the locale's script that is appropriate for display to the user.
*
* @param Locale|null $inLocale
*
* @return string
*/
public function getDisplayScript(Locale $inLocale = null)
{
return \Locale::getDisplayScript($this->locale, $inLocale ? $inLocale->locale : null);
}