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


PHP Zend_Translate::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Create a new GettextZendTranslator and configure it with passed params
  * @param string|Zend_Locale $given_locale
  * @param string $filename
  * @param boolean $default_instance If none instance yet, this instance will be used whatever this param value is
  */
 public function __construct($given_locale = null, $filename = null, $default_instance = true)
 {
     if ($filename != null) {
         $this->filename = $filename;
     }
     self::$absolutePath = Config::getInstance()->getString('appRootDir') . self::DIR_LOCALES;
     $this->debugMode = Config::getInstance()->getBoolean('i18n/gettextZendTranslator/debug', false);
     $path = self::$absolutePath . self::DEFAULT_LOCALE . '/' . $this->filename;
     parent::__construct(self::GETTEXT, $path, self::DEFAULT_LOCALE);
     // Adding other existing locales
     $locales = $this->getAvailableLocales();
     foreach ($locales as $locale) {
         if ($locale != self::DEFAULT_LOCALE) {
             parent::addTranslation(self::$absolutePath . $locale . '/' . $this->filename, $locale);
         }
     }
     if ($given_locale == null) {
         if (($given_locale = Zend_Registry::get('Zend_Locale')) == null) {
             $given_locale = self::DEFAULT_LOCALE;
         }
     }
     $this->setLocale($given_locale);
     Zend_Registry::set('Zend_Translator', $this);
     if ($default_instance || self::$instance == null) {
         self::$instance = $this;
     }
 }
开发者ID:fruition-sciences,项目名称:phpfw,代码行数:33,代码来源:GettextZendTranslator.php

示例2: __construct

 /**
  * Current module
  *
  * @param  array $options
  */
 public function __construct($options = array())
 {
     if (Axis_Area::isInstaller() || !Axis::config('core/translation/autodetect')) {
         self::setCache(Axis::cache());
     }
     $this->_module = $options['module'];
     $locale = $this->getLocale();
     $filename = $this->_getFileName($locale);
     if (!is_readable($filename)) {
         $locale = Axis_Locale::DEFAULT_LOCALE;
         $filename = $this->_getFileName($locale);
     }
     // custom modules can be without translation for default locale
     if (!is_readable($filename)) {
         $filename = $this->_getSafeFileName();
     }
     parent::__construct(array('adapter' => self::AN_CSV, 'content' => $filename, 'locale' => $locale, 'delimiter' => ','));
 }
开发者ID:baisoo,项目名称:axiscommerce,代码行数:23,代码来源:Translate.php

示例3: __construct

 /**
  * Constructor
  *
  * @return void
  */
 public function __construct($contentFile, $locale)
 {
     $this->_contentFile = $contentFile;
     parent::__construct($this->getConfig());
 }
开发者ID:BGCX261,项目名称:zlayer-svn-to-git,代码行数:10,代码来源:Translate.php

示例4: __construct

 /**
  * Konstruiert Klasse für Übersetzungen in OPUS Applikation.
  */
 public function __construct($options = null)
 {
     $options = !is_null($options) ? array_merge($this->getOptions(), $options) : $this->getOptions();
     parent::__construct($options);
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:8,代码来源:Translate.php

示例5:

 function __construct()
 {
     parent::__construct('gettext', Globals::$BASE_PATH . '/translations/en_EN.UTF-8/LC_MESSAGES/itech.mo', 'en_EN.UTF-8');
 }
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:4,代码来源:ITechTranslate.php


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