本文整理汇总了PHP中Locale::isLocaleComplete方法的典型用法代码示例。如果您正苦于以下问题:PHP Locale::isLocaleComplete方法的具体用法?PHP Locale::isLocaleComplete怎么用?PHP Locale::isLocaleComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locale
的用法示例。
在下文中一共展示了Locale::isLocaleComplete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: languages
/**
* Display form to modify site language settings.
* @param $args array
* @param $request object
*/
function languages($args, &$request)
{
$this->validate();
$this->setupTemplate(true);
$site =& $request->getSite();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('localeNames', Locale::getAllLocales());
$templateMgr->assign('primaryLocale', $site->getPrimaryLocale());
$templateMgr->assign('supportedLocales', $site->getSupportedLocales());
$localesComplete = array();
foreach (Locale::getAllLocales() as $key => $name) {
$localesComplete[$key] = Locale::isLocaleComplete($key);
}
$templateMgr->assign('localesComplete', $localesComplete);
$templateMgr->assign('installedLocales', $site->getInstalledLocales());
$templateMgr->assign('uninstalledLocales', array_diff(array_keys(Locale::getAllLocales()), $site->getInstalledLocales()));
$templateMgr->assign('helpTopicId', 'site.siteManagement');
import('classes.i18n.LanguageAction');
$languageAction = new LanguageAction();
if ($languageAction->isDownloadAvailable()) {
$templateMgr->assign('downloadAvailable', true);
$templateMgr->assign('downloadableLocales', $languageAction->getDownloadableLocales());
}
$templateMgr->display('admin/languages.tpl');
}
示例2: InstallForm
/**
* Constructor.
*/
function InstallForm()
{
parent::Form('install/install.tpl');
// FIXME Move the below options to an external configuration file?
$this->supportedLocales = Locale::getAllLocales();
$this->localesComplete = array();
foreach ($this->supportedLocales as $key => $name) {
$this->localesComplete[$key] = Locale::isLocaleComplete($key);
}
$this->supportedClientCharsets = array('utf-8' => 'Unicode (UTF-8)', 'iso-8859-1' => 'Western (ISO-8859-1)');
$this->supportedConnectionCharsets = array('' => Locale::translate('common.notApplicable'), 'utf8' => 'Unicode (UTF-8)');
$this->supportedDatabaseCharsets = array('' => Locale::translate('common.notApplicable'), 'utf8' => 'Unicode (UTF-8)');
$this->supportedEncryptionAlgorithms = array('md5' => 'MD5');
if (function_exists('sha1')) {
$this->supportedEncryptionAlgorithms['sha1'] = 'SHA1';
}
$this->supportedDatabaseDrivers = array('mysql' => array('mysql', 'MySQL'), 'postgres' => array('pgsql', 'PostgreSQL'), 'oracle' => array('oci8', 'Oracle'), 'mssql' => array('mssql', 'MS SQL Server'), 'fbsql' => array('fbsql', 'FrontBase'), 'ibase' => array('ibase', 'Interbase'), 'firebird' => array('ibase', 'Firebird'), 'informix' => array('ifx', 'Informix'), 'sybase' => array('sybase', 'Sybase'), 'odbc' => array('odbc', 'ODBC'));
// Validation checks for this form
$this->addCheck(new FormValidatorInSet($this, 'locale', 'required', 'installer.form.localeRequired', array_keys($this->supportedLocales)));
$this->addCheck(new FormValidatorCustom($this, 'locale', 'required', 'installer.form.localeRequired', array('Locale', 'isLocaleValid')));
$this->addCheck(new FormValidatorInSet($this, 'clientCharset', 'required', 'installer.form.clientCharsetRequired', array_keys($this->supportedClientCharsets)));
$this->addCheck(new FormValidator($this, 'filesDir', 'required', 'installer.form.filesDirRequired'));
$this->addCheck(new FormValidatorInSet($this, 'encryption', 'required', 'installer.form.encryptionRequired', array_keys($this->supportedEncryptionAlgorithms)));
$this->addCheck(new FormValidator($this, 'adminUsername', 'required', 'installer.form.usernameRequired'));
$this->addCheck(new FormValidatorAlphaNum($this, 'adminUsername', 'required', 'installer.form.usernameAlphaNumeric'));
$this->addCheck(new FormValidator($this, 'adminPassword', 'required', 'installer.form.passwordRequired'));
$this->addCheck(new FormValidatorCustom($this, 'adminPassword', 'required', 'installer.form.passwordsDoNotMatch', create_function('$password,$form', 'return $password == $form->getData(\'adminPassword2\');'), array(&$this)));
$this->addCheck(new FormValidatorEmail($this, 'adminEmail', 'required', 'installer.form.emailRequired'));
$this->addCheck(new FormValidatorInSet($this, 'databaseDriver', 'required', 'installer.form.databaseDriverRequired', array_keys($this->supportedDatabaseDrivers)));
$this->addCheck(new FormValidator($this, 'databaseName', 'required', 'installer.form.databaseNameRequired'));
$this->addCheck(new FormValidatorPost($this));
}
示例3: languages
/**
* Display form to modify site language settings.
*/
function languages()
{
$this->validate();
$this->setupTemplate(true);
$site =& Request::getSite();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('localeNames', Locale::getAllLocales());
$templateMgr->assign('primaryLocale', $site->getPrimaryLocale());
$templateMgr->assign('supportedLocales', $site->getSupportedLocales());
$localesComplete = array();
foreach (Locale::getAllLocales() as $key => $name) {
$localesComplete[$key] = Locale::isLocaleComplete($key);
}
$templateMgr->assign('localesComplete', $localesComplete);
$templateMgr->assign('installedLocales', $site->getInstalledLocales());
$templateMgr->assign('uninstalledLocales', array_diff(array_keys(Locale::getAllLocales()), $site->getInstalledLocales()));
$templateMgr->display('admin/languages.tpl');
}
示例4: testIsLocaleComplete
/**
* @covers PKPLocale
*/
public function testIsLocaleComplete()
{
self::assertTrue(Locale::isLocaleComplete('en_US'));
self::assertFalse(Locale::isLocaleComplete('pt_BR'));
self::assertFalse(Locale::isLocaleComplete('xx_XX'));
}