本文整理汇总了PHP中Internationalization::getCurrentLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Internationalization::getCurrentLanguage方法的具体用法?PHP Internationalization::getCurrentLanguage怎么用?PHP Internationalization::getCurrentLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Internationalization
的用法示例。
在下文中一共展示了Internationalization::getCurrentLanguage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: client
function client()
{
global $cfg;
$lang = Internationalization::getCurrentLanguage();
list($sl, $locale) = explode('_', $lang);
$rtl = false;
foreach (Internationalization::availableLanguages() as $info) {
if (isset($info['direction'])) {
$rtl = true;
}
}
$config = array('html_thread' => (bool) $cfg->isHtmlThreadEnabled(), 'lang' => $lang, 'short_lang' => $sl, 'has_rtl' => $rtl);
$config = $this->json_encode($config);
Http::cacheable(md5($config), $cfg->lastModified());
header('Content-Type: application/json; charset=UTF-8');
return $config;
}
示例3: getTipsJson
function getTipsJson($namespace, $lang = false)
{
global $ost, $thisstaff;
$lang = Internationalization::getCurrentLanguage();
$i18n = new Internationalization($lang);
$tips = $i18n->getTemplate("help/tips/{$namespace}.yaml");
if (!$tips || !($data = $tips->getData())) {
Http::response(404, 'Help content not available');
}
// Translate links to the root path of this installation
foreach ($data as $tip => &$info) {
if ($ost) {
$info = $ost->replaceTemplateVariables($info, array('config' => $ost->getConfig()));
}
if (isset($info['links'])) {
foreach ($info['links'] as &$l) {
if ($l['href'][0] == '/') {
$l['href'] = ROOT_PATH . substr($l['href'], 1);
}
}
}
}
return $this->json_encode($data);
}
示例4: 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;
?>
示例5: __
?>
</a>
</div>
<div id="overlay"></div>
<div id="loading">
<h4><?php
echo __('Please Wait!');
?>
</h4>
<p><?php
echo __('Please wait... it will take a second!');
?>
</p>
</div>
<?php
if (($lang = Internationalization::getCurrentLanguage()) && $lang != 'en_US') {
?>
<script type="text/javascript" src="ajax.php/i18n/<?php
echo $lang;
?>
/js"></script>
<?php
}
?>
</body>
<script>
//Tell the window to respond to the width, along with the whole middle part.
jQuery("div#container").css("width","100%");// dynamic width to fit into the screen.
jQuery("table").attr('width', "100%"); //now that that has been resized, we need to make sure the th's fit within it.
jQuery(".message th:nth-child(1)").attr('width',"20%");
示例6: 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>