当前位置: 首页>>代码示例>>PHP>>正文


PHP locale::get方法代码示例

本文整理汇总了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] . '\'';
开发者ID:radiosilence,项目名称:quickbox,代码行数:31,代码来源:standardContent.disp.php

示例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);
}
开发者ID:cepharum,项目名称:txf,代码行数:15,代码来源:shortcuts.php


注:本文中的locale::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。