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


PHP AppLocale::getLocaleFiles方法代码示例

本文整理汇总了PHP中AppLocale::getLocaleFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP AppLocale::getLocaleFiles方法的具体用法?PHP AppLocale::getLocaleFiles怎么用?PHP AppLocale::getLocaleFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppLocale的用法示例。


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

示例1: register

 function register($category, $path)
 {
     if (parent::register($category, $path)) {
         if ($this->getEnabled()) {
             // Add custom locale data for already registered locale files.
             $locale = AppLocale::getLocale();
             $localeFiles = AppLocale::getLocaleFiles($locale);
             $journal = Request::getJournal();
             $journalId = $journal->getId();
             $publicFilesDir = Config::getVar('files', 'public_files_dir');
             $customLocalePathBase = $publicFilesDir . DIRECTORY_SEPARATOR . 'journals' . DIRECTORY_SEPARATOR . $journalId . DIRECTORY_SEPARATOR . CUSTOM_LOCALE_DIR . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR;
             import('lib.pkp.classes.file.FileManager');
             $fileManager = new FileManager();
             foreach ($localeFiles as $localeFile) {
                 $customLocalePath = $customLocalePathBase . $localeFile->getFilename();
                 if ($fileManager->fileExists($customLocalePath)) {
                     AppLocale::registerLocaleFile($locale, $customLocalePath, true);
                 }
             }
             // Add custom locale data for all locale files registered after this plugin
             HookRegistry::register('PKPLocale::registerLocaleFile', array(&$this, 'addCustomLocale'));
         }
         return true;
     }
     return false;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:26,代码来源:CustomLocalePlugin.inc.php

示例2: LocaleFile

 /**
  * Register a locale file against the current list.
  * @param $locale string Locale key
  * @param $filename string Filename to new locale XML file
  * @param $addToTop boolean Whether to add to the top of the list (true)
  * 	or the bottom (false). Allows overriding.
  */
 function &registerLocaleFile($locale, $filename, $addToTop = false)
 {
     $localeFiles =& AppLocale::getLocaleFiles($locale);
     $localeFile = new LocaleFile($locale, $filename);
     if (!$localeFile->isValid()) {
         $localeFile = null;
         return $localeFile;
     }
     if ($addToTop) {
         // Work-around: unshift by reference.
         array_unshift($localeFiles, '');
         $localeFiles[0] =& $localeFile;
     } else {
         $localeFiles[] =& $localeFile;
     }
     HookRegistry::call('PKPLocale::registerLocaleFile', array(&$locale, &$filename, &$addToTop));
     return $localeFile;
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:25,代码来源:PKPLocale.inc.php


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