本文整理汇总了PHP中Internationalization::getLanguageInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Internationalization::getLanguageInfo方法的具体用法?PHP Internationalization::getLanguageInfo怎么用?PHP Internationalization::getLanguageInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Internationalization
的用法示例。
在下文中一共展示了Internationalization::getLanguageInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configureForUser
static function configureForUser($user = false)
{
$lang = Internationalization::getCurrentLanguage($user);
$info = Internationalization::getLanguageInfo(strtolower($lang));
if (!$info) {
// Not a supported language
return;
}
// Define locale for C-libraries
putenv('LC_ALL=' . $info['code']);
self::setLocale(LC_ALL, $info['code']);
}
示例2: is_object
<?php
$title = $cfg && is_object($cfg) && $cfg->getTitle() ? $cfg->getTitle() : 'osTicket :: ' . __('Support Ticket System');
$signin_url = ROOT_PATH . "login.php" . ($thisclient ? "?e=" . urlencode($thisclient->getEmail()) : "");
$signout_url = ROOT_PATH . "logout.php?auth=" . $ost->getLinkToken();
header("Content-Type: text/html; charset=UTF-8");
?>
<!DOCTYPE html>
<html <?php
if (($lang = Internationalization::getCurrentLanguage()) && ($info = Internationalization::getLanguageInfo($lang)) && @$info['direction'] == 'rtl') {
echo 'dir="rtl" class="rtl"';
}
?>
>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php
echo Format::htmlchars($title);
?>
</title>
<meta name="description" content="customer support platform">
<meta name="keywords" content="osTicket, Customer support system, support ticket system">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="<?php
echo ROOT_PATH;
?>
css/osticket.css?19292ad" media="screen"/>
<link rel="stylesheet" href="<?php
echo ASSETS_PATH;
?>
示例3: array
if (!in_array(strtolower(basename($_SERVER['SCRIPT_NAME'])), array('logo.php', 'file.php')) && !(is_object($ost) && $ost->isSystemOnline())) {
include ROOT_DIR . 'offline.php';
exit;
}
/* include what is needed on client stuff */
require_once INCLUDE_DIR . 'class.client.php';
require_once INCLUDE_DIR . 'class.ticket.php';
require_once INCLUDE_DIR . 'class.dept.php';
//clear some vars
$errors = array();
$msg = '';
$nav = null;
//Make sure the user is valid..before doing anything else.
$thisclient = UserAuthenticationBackend::getUser();
if (isset($_GET['lang']) && $_GET['lang']) {
if (Internationalization::getLanguageInfo($_GET['lang'])) {
$_SESSION['client:lang'] = $_GET['lang'];
}
}
// Bootstrap gettext translations as early as possible, but after attempting
// to sign on the agent
TextDomain::configureForUser($thisclient);
//is the user logged in?
if ($thisclient && $thisclient->getId() && $thisclient->isValid()) {
$thisclient->refreshSession();
} else {
$thisclient = null;
}
/******* CSRF Protectin *************/
// Enforce CSRF protection for POSTS
if ($_POST && !$ost->checkCSRFToken()) {
示例4: foreach
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html <?php
if (($lang = Internationalization::getCurrentLanguage())
&& ($info = Internationalization::getLanguageInfo($lang))
&& (@$info['direction'] == 'rtl'))
echo 'dir="rtl" class="rtl"';
?>>
<head>
<title><?php echo $wizard['title']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/wizard.css?c18eac4">
<link type="text/css" rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/flags.css?c18eac4">
<script type="text/javascript" src="../js/jquery-1.8.3.min.js?c18eac4"></script>
<script type="text/javascript" src="js/tips.js?c18eac4"></script>
<script type="text/javascript" src="js/setup.js?c18eac4"></script>
</head>
<body>
<div id="wizard">
<div id="header">
<img id="logo" src="./images/<?php echo $wizard['logo']?$wizard['logo']:'logo.png'; ?>" width="280" height="72" alt="osTicket">
<div class="info"><?php echo $wizard['tagline']; ?></div>
<br/>
<ul class="links">
<li>
<?php
foreach($wizard['menu'] as $k=>$v)
echo sprintf('<a target="_blank" href="%s">%s</a> — ',$v,$k);
?>
<a target="_blank" href="http://osticket.com/contact-us"><?php echo __('Contact Us');?></a>
</li>