本文整理汇总了PHP中locales::available方法的典型用法代码示例。如果您正苦于以下问题:PHP locales::available方法的具体用法?PHP locales::available怎么用?PHP locales::available使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类locales
的用法示例。
在下文中一共展示了locales::available方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
public function setup()
{
self::$installed_locales = locales::installed();
self::$default_locale = module::get_var("gallery", "default_locale");
locales::update_installed(array_keys(locales::available()));
module::set_var("gallery", "default_locale", "no_NO");
}
示例2: index
public function index($share_translations_form = null)
{
$v = new Admin_View("admin.html");
$v->content = new View("admin_languages.html");
$v->content->available_locales = locales::available();
$v->content->installed_locales = locales::installed();
$v->content->default_locale = module::get_var("gallery", "default_locale");
if (empty($share_translations_form)) {
$share_translations_form = $this->_share_translations_form();
}
$v->content->share_translations_form = $share_translations_form;
$this->_outgoing_translations_count();
print $v;
}
示例3: _languages_form
private function _languages_form()
{
$all_locales = locales::available();
$installed_locales = locales::installed();
$form = new Forge("admin/languages/save", "", "post", array("id" => "gLanguageSettingsForm"));
$group = $form->group("choose_language")->label(t("Language settings"));
$group->dropdown("locale")->options($installed_locales)->selected(module::get_var("gallery", "default_locale"))->label(t("Default language"))->rules('required');
$installation_options = array();
foreach ($all_locales as $code => $display_name) {
$installation_options[$code] = array($display_name, isset($installed_locales->{$code}));
}
$group->checklist("installed_locales")->label(t("Installed Languages"))->options($installation_options)->rules("required");
$group->submit("save")->value(t("Save settings"));
return $form;
}