本文整理汇总了PHP中thebuggenie\core\framework\Settings::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::getLanguage方法的具体用法?PHP Settings::getLanguage怎么用?PHP Settings::getLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\framework\Settings
的用法示例。
在下文中一共展示了Settings::getLanguage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 (\thebuggenie\core\framework\Settings::getLanguage() == $lang_code) {
?>
<?php
echo __('(site default)');
}
?>
</option>
<?php
}
?>
</select>
</td>
</tr>
</table>
<h3><?php
echo __('Additional information');
示例2: getLanguage
public function getLanguage()
{
return $this->_language != '' ? $this->_language : framework\Settings::getLanguage();
}
示例3: setupI18n
protected static function setupI18n()
{
Logging::log('Initializing i18n');
if (!self::isCLI()) {
$language = self::$_user instanceof User ? self::$_user->getLanguage() : Settings::getLanguage();
if (self::$_user instanceof User && self::$_user->getLanguage() == 'sys') {
$language = Settings::getLanguage();
}
Logging::log("Initializing i18n with language {$language}");
self::$_i18n = new I18n($language);
self::$_i18n->initialize();
}
Logging::log('done (initializing i18n)');
}