当前位置: 首页>>代码示例>>PHP>>正文


PHP _locale_get_predefined_list函数代码示例

本文整理汇总了PHP中_locale_get_predefined_list函数的典型用法代码示例。如果您正苦于以下问题:PHP _locale_get_predefined_list函数的具体用法?PHP _locale_get_predefined_list怎么用?PHP _locale_get_predefined_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_locale_get_predefined_list函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hpoFormater

/**
 * Formata uma consulta SQL em um vetor para header PO
 * @param resource $linha
 * @param bolean $reset - reinicia a data
 * @return multitype:NULL string unknown 
 */
function hpoFormater($linha, $reset = false)
{
    static $udate = NULL;
    global $language;
    if ($reset == true) {
        $udate = NULL;
    }
    if (!$udate) {
        $udate = $linha['ultima_alter'];
    }
    $udate = $udate > $linha['ultima_alter'] ? $udate : $linha['ultima_alter'];
    $team = _locale_get_predefined_list();
    $arg = array('Project-Id-Version' => $linha['version'], 'POT-Creation-Date' => $linha['pot'], 'PO-Revision-Date' => $udate, 'Last-Translator' => $linha['ultimo_tradutor'], 'Language' => $linha['language'], 'Language-Team' => $team[$linha['language']][0], 'MIME-Version' => '1.0', 'Content-Type' => 'text/plain; charset=utf-8', 'Content-Transfer-Encoding' => $language['language']->encoding . 'bit', 'Plural-Forms' => "nplurals=" . $language['language']->plurals . "; plural=" . $language['language']->formula . ";");
    return $arg;
}
开发者ID:renatoinnocenti,项目名称:ModulosZend,代码行数:21,代码来源:fnc.Language.php

示例2: install_select_locale_form

/**
 * Form API array definition for language selection.
 */
function install_select_locale_form(&$form_state, $locales)
{
    include_once './includes/locale.inc';
    $languages = _locale_get_predefined_list();
    foreach ($locales as $locale) {
        // Try to use verbose locale name
        $name = $locale->name;
        if (isset($languages[$name])) {
            $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' ' . st('(@language)', array('@language' => $languages[$name][1])) : '');
        }
        $form['locale'][$locale->name] = array('#type' => 'radio', '#return_value' => $locale->name, '#default_value' => $locale->name == 'en' ? TRUE : FALSE, '#title' => $name . ($locale->name == 'en' ? ' ' . st('(built-in)') : ''), '#parents' => array('locale'));
    }
    $form['submit'] = array('#type' => 'submit', '#value' => st('Select language'));
    return $form;
}
开发者ID:alexismb5,项目名称:ckan-drupal,代码行数:18,代码来源:install.php

示例3: install_select_locale_form

/**
 * Form API array definition for language selection.
 */
function install_select_locale_form($form, &$form_state, $locales, $profilename = 'standard')
{
    include_once DRUPAL_ROOT . '/includes/iso.inc';
    $languages = _locale_get_predefined_list();
    foreach ($locales as $locale) {
        // Try to use verbose locale name
        $name = $locale->name;
        if (isset($languages[$name])) {
            $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' ' . st('(@language)', array('@language' => $languages[$name][1])) : '');
        }
        $form['locale'][$locale->name] = array('#type' => 'radio', '#return_value' => $locale->name, '#default_value' => $locale->name == 'en' ? 'en' : '', '#title' => $name . ($locale->name == 'en' ? ' ' . st('(built-in)') : ''), '#parents' => array('locale'));
    }
    if ($profilename == 'standard') {
        $form['help'] = array('#markup' => '<p><a href="install.php?profile=' . $profilename . '&amp;localize=true">' . st('Learn how to install Drupal in other languages') . '</a></p>');
    }
    $form['actions'] = array('#type' => 'container', '#attributes' => array('class' => array('form-actions')));
    $form['actions']['submit'] = array('#type' => 'submit', '#value' => st('Save and continue'));
    return $form;
}
开发者ID:berkes,项目名称:sympal,代码行数:22,代码来源:install.php

示例4: languageCreate

 /**
  * {@inheritdoc}
  */
 public function languageCreate(\stdClass $language)
 {
     if (!module_exists('locale')) {
         throw new \Exception(sprintf("%s::%s line %s: This driver requires the 'locale' module be enabled in order to create languages", get_class($this), __FUNCTION__, __LINE__));
     }
     include_once DRUPAL_ROOT . '/includes/iso.inc';
     include_once DRUPAL_ROOT . '/includes/locale.inc';
     // Get all predefined languages, regardless if they are enabled or not.
     $predefined_languages = _locale_get_predefined_list();
     // If the language code is not valid then throw an InvalidArgumentException.
     if (!isset($predefined_languages[$language->langcode])) {
         throw new InvalidArgumentException("There is no predefined language with langcode '{$language->langcode}'.");
     }
     // Enable a language only if it has not been enabled already.
     $enabled_languages = locale_language_list();
     if (!isset($enabled_languages[$language->langcode])) {
         locale_add_language($language->langcode);
         return $language;
     }
     return FALSE;
 }
开发者ID:acbramley,项目名称:DrupalDriver,代码行数:24,代码来源:Drupal7.php

示例5: removeLanguageNegotiationSuffix

 /**
  * Remove language negotiation suffix from the end of the URL, if any.
  *
  * @param string $url
  *    Requested URL.
  *
  * @return string
  *    Sanitized URL.
  */
 protected function removeLanguageNegotiationSuffix($url)
 {
     include_once DRUPAL_ROOT . '/includes/iso.inc';
     $languages = implode('|_', array_keys(_locale_get_predefined_list()));
     $sanitized_url = preg_replace("/(_{$languages})\$/i", '', $url);
     if ($sanitized_url == $url) {
         $this->setDebugHeader('Language suffix not found');
     }
     return $sanitized_url;
 }
开发者ID:ec-europa,项目名称:platform-dev,代码行数:19,代码来源:LanguageCoverageService.php

示例6: languageCreate

 /**
  * {@inheritdoc}
  */
 public function languageCreate(\stdClass $language)
 {
     include_once DRUPAL_ROOT . '/includes/iso.inc';
     include_once DRUPAL_ROOT . '/includes/locale.inc';
     // Get all predefined languages, regardless if they are enabled or not.
     $predefined_languages = _locale_get_predefined_list();
     // If the language code is not valid then throw an InvalidArgumentException.
     if (!isset($predefined_languages[$language->langcode])) {
         throw new InvalidArgumentException("There is no predefined language with langcode '{$language->langcode}'.");
     }
     // Enable a language only if it has not been enabled already.
     $enabled_languages = locale_language_list();
     if (!isset($enabled_languages[$language->langcode])) {
         locale_add_language($language->langcode);
         return $language;
     }
     return FALSE;
 }
开发者ID:nedjo,项目名称:DrupalDriver,代码行数:21,代码来源:Drupal7.php

示例7: getLanguageURL

/**
 * Extrai o prefixo e refaz a query
 * @param array $query - Comum $_GET[q]
 * @return string array [novo array,prefixo]
 */
function getLanguageURL($query)
{
    $args = explode('/', $query);
    $a = array_intersect($args, array_keys(_locale_get_predefined_list()));
    if ($a) {
        $prefix = $args[key($a)];
        unset($args[key($a)]);
    }
    $out[0] = implode('/', $args);
    $out[1] = $prefix;
    return $out;
}
开发者ID:renatoinnocenti,项目名称:ModulosZend,代码行数:17,代码来源:fnc.Globals.php

示例8: foreach

<?php

$files = `pacman -Qql drupal | egrep '(bootstrap|iso).inc'`;
foreach (preg_split("/\\s+/", $files) as $file) {
    if (!empty($file)) {
        require $file;
    }
}
echo '( ';
foreach (_locale_get_predefined_list() as $key => $names) {
    echo "[{$key}]=\"{$names['0']}\" ";
}
echo ')';
开发者ID:realitygaps,项目名称:aur-pkgs,代码行数:13,代码来源:get-locales-names.php

示例9: GetLanguage

 private function GetLanguage()
 {
     //negociar a tradução o GET sempre tem prioridade.
     if ($this->perfil->MEMBER_ID > 0 && isset($languages[$this->perfil->language])) {
         $this->cfg['language_default'] = $this->cfg['language'][$this->perfil->language];
     } elseif (isset($this->cfg['language'][$this->cfg['country_lng']])) {
         $this->cfg['language_default'] = $this->cfg['language'][$this->cfg['country_lng']];
     }
     if (isset($_GET['q'])) {
         $args = explode('/', $_GET['q']);
         if (array_key_exists($args[0], _locale_get_predefined_list())) {
             $prefix = array_shift($args);
             if ($this->cfg['language'][$prefix]) {
                 $this->cfg['language_default'] = $this->cfg['language'][$prefix];
             } else {
                 $this->cfg['language_default'] = language_default();
             }
             $_GET['q'] = implode('/', $args);
         }
     }
     if (!$this->language['language_default']) {
         $this->cfg['language_default'] = language_default();
     }
 }
开发者ID:renatoinnocenti,项目名称:ModulosZend,代码行数:24,代码来源:lib.StartSite.php


注:本文中的_locale_get_predefined_list函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。