本文整理汇总了PHP中Locale::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Locale::start方法的具体用法?PHP Locale::start怎么用?PHP Locale::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locale
的用法示例。
在下文中一共展示了Locale::start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareConfigForm
function prepareConfigForm()
{
$view = $this->tpl();
/* We load the user configuration */
$this->user->reload();
$l = Locale::start();
$view->assign('languages', $l->getList());
$view->assign('me', $this->user->getLogin());
$view->assign('conf', $this->user->getConfig());
$view->assign('submit', $this->call('ajaxSubmit', "movim_parse_form('general')") . "this.className='button color orange inactive oppose';\n this.onclick=null;");
return $view->draw('_config_form', true);
}
示例2: reload
/**
* @brief Reload the user configuration
*/
function reload()
{
$session = \Sessionx::start();
if ($session->config) {
$this->config = $session->config;
$lang = $this->getConfig('language');
if (isset($lang)) {
$l = Locale::start();
$l->load($lang);
}
$cd = new modl\CapsDAO();
$caps = $cd->get($session->host);
$this->caps = unserialize($caps->features);
}
}
示例3: display
function display()
{
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$l = Locale::start();
$this->view->assign('conf', $cd->get());
$this->view->assign('logs', array(0 => $this->__('log.empty'), 1 => $this->__('log.syslog'), 2 => $this->__('log.syslog_files')));
$this->view->assign('bosh_info4', $this->__('bosh.info4', '<a href="http://wiki.movim.eu/en:install">', '</a>'));
$json = requestURL(MOVIM_API . 'websockets', 1);
$json = json_decode($json);
if (isset($json) && $json->status != 404) {
$this->view->assign('websockets', $json);
}
$this->view->assign('server_rewrite', false);
if (isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) {
$this->view->assign('server_rewrite', true);
}
$this->view->assign('timezones', getTimezoneList());
$this->view->assign('langs', $l->getList());
}
示例4: loadLanguage
/**
* Loads up the language, either from the User or default.
*/
function loadLanguage()
{
$user = new User();
$user->reload();
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$l = Locale::start();
if ($user->isLogged()) {
$lang = $user->getConfig('language');
if (isset($lang)) {
$l->load($lang);
} else {
// Load default language.
$l->load($config->locale);
}
} elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$l->detect();
$l->loadPo();
} else {
$l->load($config->locale);
}
}
示例5: __
function __()
{
$args = func_get_args();
$l = Locale::start();
$string = array_shift($args);
return $l->translate($string, $args);
}