本文整理汇总了PHP中TBGSettings::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGSettings::getLanguage方法的具体用法?PHP TBGSettings::getLanguage怎么用?PHP TBGSettings::getLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGSettings
的用法示例。
在下文中一共展示了TBGSettings::getLanguage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLanguage
public function getLanguage()
{
return $this->_language != '' ? $this->_language : TBGSettings::getLanguage();
}
示例2: foreach
</option>
<?php
foreach ($languages as $lang_code => $lang_desc) {
?>
<option value="<?php
echo $lang_code;
?>
" <?php
if ($tbg_user->getLanguage() == $lang_code) {
?>
selected<?php
}
?>
><?php
echo $lang_desc;
if (TBGSettings::getLanguage() == $lang_code) {
?>
<?php
echo __('(site default)');
}
?>
</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td class="config_explanation" colspan="2">
<?php
示例3: setupI18n
protected static function setupI18n()
{
TBGLogging::log('Initializing i18n');
if (!TBGContext::isCLI()) {
$language = self::$_user instanceof TBGUser ? self::$_user->getLanguage() : TBGSettings::getLanguage();
if (self::$_user instanceof TBGUser && self::$_user->getLanguage() == 'sys') {
$language = TBGSettings::getLanguage();
}
TBGLogging::log('Loading i18n strings');
if (!(self::$_i18n = TBGCache::get(TBGCache::KEY_I18N . $language, false))) {
TBGLogging::log("Loading strings from file ({$language})");
self::$_i18n = new TBGI18n($language);
if (!self::isInstallmode()) {
TBGCache::add(TBGCache::KEY_I18N . $language, self::$_i18n, false);
}
} else {
TBGLogging::log('Using cached i18n strings');
}
self::$_i18n->initialize();
}
TBGLogging::log('done (initializing i18n)');
}