本文整理汇总了PHP中Locale::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Locale::getLanguage方法的具体用法?PHP Locale::getLanguage怎么用?PHP Locale::getLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locale
的用法示例。
在下文中一共展示了Locale::getLanguage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCurrentLocale
/**
* Returns the current locale. This is the default locale if
* no current lcoale has been set or the set current locale has
* a language code of "mul".
*
* @return \TYPO3\FLOW3\I18n\Locale
*/
public function getCurrentLocale()
{
if (!$this->currentLocale instanceof \TYPO3\FLOW3\I18n\Locale || $this->currentLocale->getLanguage() === 'mul') {
return $this->defaultLocale;
}
return $this->currentLocale;
}
示例2: testGetLanguage
/**
* Tests Locale->getLanguage()
*/
public function testGetLanguage()
{
$this->assertEquals('EN', $this->Locale->getLanguage());
}
示例3: header
if ($basename == 'index.php') {
header('Content-type: text/html; charset=UFT-8', true);
}
// Show errors
error_reporting(E_ALL);
// Includes path
set_include_path('app/' . PATH_SEPARATOR . 'admin/app/' . PATH_SEPARATOR . 'admin/app/ado/' . PATH_SEPARATOR . 'admin/app/control/' . PATH_SEPARATOR . 'admin/app/model/' . PATH_SEPARATOR . 'admin/app/inc/' . PATH_SEPARATOR . 'admin/app/config/' . PATH_SEPARATOR . get_include_path());
// Autload classes
function __autoload($file)
{
$paths = array('app/', 'admin/app/', 'admin/app/ado/', 'admin/app/control/', 'admin/app/model/', 'admin/app/inc/', 'admin/app/config/');
foreach ($paths as $path) {
if (is_file($path . $file . '.class.php')) {
require $path . $file . '.class.php';
break;
}
}
}
// Debug
function pr($array)
{
echo '<div style="border:2px solid #000;padding:10px;background:#e1e1e1;margin:10px;">';
echo '<pre>';
print_r($array);
echo '</pre>';
echo '</div>';
}
// Language
$language = Locale::getLanguage();
// Configuration
require_once 'config.php';