本文整理汇总了PHP中locale::get方法的典型用法代码示例。如果您正苦于以下问题:PHP locale::get方法的具体用法?PHP locale::get怎么用?PHP locale::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类locale
的用法示例。
在下文中一共展示了locale::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
* @subpackage dispatcher
* @category dispatcher
*/
# get page data associated with page
# These common replacements for {templatey} type things in the content. Feature is minimal for speed.
$needles = array (
'{page}'
);
$haystacks = array (
config::get('site/htmlRoot') . config::get('site/pagePrefix')
);
if(locale::get() !== 'en')
{
$langQuery = 'AND `lang` = \''.locale::get().'\'';
}
# We are going to get the extra content from the pagevars.
if (strlen($this->dPage['pageVars']['content']) > 0)
{
$extraContent = explode(',', $this->dPage['pageVars']['content']);
}
if (is_array($extraContent))
{
foreach ($extraContent as $k => $v)
{
$t = explode('=', $extraContent[$k]);
$extraContent[$t[0]] = $t[1];
unset($extraContent[$k]);
$extraQuery .= ' OR `name` = \'' . $t[1] . '\'';
示例2: _L
/**
* Looks up localized version of provided text matching selected number of items
* text is referring to.
*
* @param string $singular default text to show on single item
* @param string $plural default text to show on no/multiple items
* @param integer $count number of items text is considered to refer to
* @param string $fallbackSingular optional translation to provide on missing (match in) translation table for singular form
* @param string $fallbackPlural optional translation to provide on missing (match in) translation table for plural form
* @return string localized version of text or related text in $singular/$plural on mismatch
*/
function _L($singular, $plural = null, $count = 1, $fallbackSingular = null, $fallbackPlural = null)
{
return locale::get($singular, is_null($plural) ? $singular : $plural, $count, $fallbackSingular, $fallbackPlural);
}