本文整理汇总了PHP中I18n::available_langs方法的典型用法代码示例。如果您正苦于以下问题:PHP I18n::available_langs方法的具体用法?PHP I18n::available_langs怎么用?PHP I18n::available_langs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类I18n
的用法示例。
在下文中一共展示了I18n::available_langs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_available_langs
public function get_available_langs()
{
$langs = I18n::available_langs();
$system_default = Arr::get($langs, Config::get('site', 'default_locale'));
$langs[Model_User::DEFAULT_LOCALE] = __('System default (:locale)', array(':locale' => $system_default));
return $langs;
}
示例2: _execute
protected function _execute(array $params)
{
if ($params['db_driver'] === NULL) {
$params['db_driver'] = Minion_CLI::read(__('Please enter database driver (:types)', array(':types' => implode(', ', array_keys($this->_installer->database_drivers())))));
}
if ($params['locale'] === NULL) {
$params['locale'] = Minion_CLI::read(__('Please enter locale (:types)', array(':types' => implode(', ', array_keys(I18n::available_langs())))));
}
if ($params['db_name'] === NULL) {
$params['db_name'] = Minion_CLI::read(__('Please enter database name'));
}
if ($params['timezone'] === NULL) {
$answer = Minion_CLI::read(__('Select current timezone automaticly (:current)', array(':current' => date_default_timezone_get())), array('y', 'n'));
if ($answer == 'y') {
$params['timezone'] = date_default_timezone_get();
} else {
$params['timezone'] = Minion_CLI::read(__('Please enter current timezone (:site)', array(':site' => 'http://www.php.net/manual/en/timezones.php')), DateTimeZone::listIdentifiers());
}
}
if ($params['cache_type'] === NULL) {
$params['cache_type'] = Minion_CLI::read(__('Please enter cache type (:types)', array(':types' => implode(', ', array_keys($this->_installer->cache_types())))));
}
if ($params['session_type'] === NULL) {
$session_types = Kohana::$config->load('installer')->get('session_types', array());
$params['session_type'] = Minion_CLI::read(__('Please enter session type (:types)', array(':types' => implode(', ', array_keys($this->_installer->session_types())))));
}
if ($params['password'] !== NULL) {
unset($params['password_generate']);
$params['password_field'] = $params['password_confirm'] = $params['password'];
}
try {
$this->_installer->install($params);
Observer::notify('after_install', $params);
Cache::clear_file();
Minion_CLI::write('==============================================');
Minion_CLI::write(__('KodiCMS installed successfully'));
Minion_CLI::write('==============================================');
$install_data = Session::instance()->get_once('install_data');
Minion_CLI::write(__('Login: :login', array(':login' => Arr::get($install_data, 'username'))));
Minion_CLI::write(__('Password: :password', array(':password' => Arr::get($install_data, 'password_field'))));
} catch (Exception $e) {
Minion_CLI::write(__(':text | :file [:line]', array(':text' => $e->getMessage(), ':file' => $e->getFile(), ':line' => $e->getLine())));
}
}
示例3: __
</div>
<div class="panel-heading" data-icon="globe">
<span class="panel-title"><?php
echo __('Regional settings');
?>
</span>
</div>
<div class="panel-body">
<div class="form-group">
<?php
echo Form::label('setting_default_locale', __('Default interface language'), array('class' => 'control-label col-md-4'));
?>
<div class="col-md-3">
<?php
echo Form::select('setting[site][default_locale]', I18n::available_langs(), Config::get('site', 'default_locale'), array('id' => 'setting_default_locale', 'class' => 'form-control'));
?>
</div>
</div>
<div class="form-group">
<?php
echo Form::label('setting_date_format', __('Date format'), array('class' => 'control-label col-md-4'));
?>
<div class="col-md-3">
<?php
echo Form::select('setting[site][date_format]', $dates, Config::get('site', 'date_format'), array('id' => 'setting_date_format'));
?>
</div>
</div>
</div>
示例4: defined
<?php
defined('SYSPATH') or die('No direct script access.');
define('INSTALL_DATA', MODPATH . 'installer' . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR);
if (array_key_exists(Arr::get($_GET, 'lang'), I18n::available_langs())) {
I18n::lang(Arr::get($_GET, 'lang'));
} else {
I18n::lang(I18n::detect_lang());
}
try {
date_default_timezone_get();
} catch (Exception $e) {
date_default_timezone_set('UTC');
}
Database::$default = 'install';
Route::set('install', 'install(/<action>(/<id>))')->defaults(array('controller' => 'install', 'action' => 'error'));
Assets_Package::add('install')->js(NULL, ADMIN_RESOURCES . 'js/install.js', 'global')->css(NULL, ADMIN_RESOURCES . 'css/install.css', 'global');
示例5: __
<div class="panel-heading" data-icon="globe">
<span class="panel-title"><?php
echo __('Regional settings');
?>
</span>
</div>
<div class="panel-body">
<div class="form-group">
<label class="control-label col-md-3"><?php
echo __('Interface language');
?>
</label>
<div class="col-md-3">
<?php
echo Form::select('install[locale]', I18n::available_langs(), Arr::get($data, 'locale'));
?>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3"><?php
echo __('Timezone');
?>
</label>
<div class="col-md-3">
<?php
echo Form::select('install[timezone]', Date::timezones(), Arr::get($data, 'timezone'));
?>
</div>
</div>