本文整理汇总了PHP中Internationalization::availableLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP Internationalization::availableLanguages方法的具体用法?PHP Internationalization::availableLanguages怎么用?PHP Internationalization::availableLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Internationalization
的用法示例。
在下文中一共展示了Internationalization::availableLanguages方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: __
?>
<a href="<?php
echo $signin_url;
?>
"><?php
echo __('Sign In');
?>
</a>
<?php
}
}
?>
</p>
<p>
<?php
if (($all_langs = Internationalization::availableLanguages()) && count($all_langs) > 1) {
foreach ($all_langs as $code => $info) {
list($lang, $locale) = explode('_', $code);
?>
<a class="flag flag-<?php
echo strtolower($locale ?: $info['flag'] ?: $lang);
?>
"
href="?<?php
echo urlencode($_GET['QUERY_STRING']);
?>
&lang=<?php
echo $code;
?>
" title="<?php
echo Internationalization::getLanguageDescription($code);
示例3: __
}
}
?>
</select>
<span class="error">* <?php echo $errors['tpl_id']; ?></span><i class="help-tip icon-question-sign" href="#template_to_clone"></i>
</td>
</tr>
</tbody>
<tbody id="language">
<tr>
<td width="180" class="required">
<?php echo __('Language'); ?>:
</td>
<td>
<?php
$langs = Internationalization::availableLanguages(); ?>
<select name="lang_id">
<?php foreach($langs as $l) {
$selected = ($info['lang_id'] == $l['code']) ? 'selected="selected"' : ''; ?>
<option value="<?php echo $l['code']; ?>" <?php echo $selected;
?>><?php echo Internationalization::getLanguageDescription($l['code']); ?></option>
<?php } ?>
</select>
<span class="error">* <?php echo $errors['lang_id']; ?></span>
<i class="help-tip icon-question-sign" href="#language"></i>
</td>
</tr>
</tbody>
<tbody>
<?php } ?>
<tr>
示例4: db_result
FROM information_schema.TABLES WHERE table_schema = '
.db_input(DBNAME);
$space = db_result(db_query($sql));
echo sprintf('%.2f MiB', $space); ?></td>
<tr><td><?php echo __('Space for Attachments'); ?></td>
<td><?php
$sql = 'SELECT SUM(LENGTH(filedata)) / 1048576 FROM '.FILE_CHUNK_TABLE;
$space = db_result(db_query($sql));
echo sprintf('%.2f MiB', $space); ?></td>
</tbody>
</table>
<br/>
<h2><?php echo __('Installed Language Packs'); ?></h2>
<div style="margin: 0 20px">
<?php
foreach (Internationalization::availableLanguages() as $info) {
$p = $info['path'];
if ($info['phar']) $p = 'phar://' . $p;
if (file_exists($p . '/MANIFEST.php')) {
$manifest = (include $p . '/MANIFEST.php'); ?>
<h3><strong><?php echo Internationalization::getLanguageDescription($info['code']); ?></strong>
— <?php echo $manifest['Language']; ?>
<?php if ($info['phar'])
Plugin::showVerificationBadge($info['path']);
?>
</h3>
<div><?php echo __('Version'); ?>: <?php echo $manifest['Version']; ?>,
<?php echo __('Built'); ?>: <?php echo $manifest['Build-Date']; ?>
</div>
<?php }
} ?>
示例5: foreach
<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>
</ul>
<div class="flags">
<?php
if (($all_langs = Internationalization::availableLanguages())
&& (count($all_langs) > 1)
) {
foreach ($all_langs as $code=>$info) {
list($lang, $locale) = explode('_', $code);
?>
<a class="flag flag-<?php echo strtolower($locale ?: $info['flag'] ?: $lang); ?>"
href="?<?php echo urlencode($_GET['QUERY_STRING']); ?>&lang=<?php echo $code;
?>" title="<?php echo Internationalization::getLanguageDescription($code); ?>"> </a>
<?php }
} ?>
</div>
</div>
<div class="clear"></div>
<div id="content">