本文整理汇总了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;
}
}
示例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' => ','));
}
示例3: __construct
/**
* Constructor
*
* @return void
*/
public function __construct($contentFile, $locale)
{
$this->_contentFile = $contentFile;
parent::__construct($this->getConfig());
}
示例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);
}
示例5:
function __construct()
{
parent::__construct('gettext', Globals::$BASE_PATH . '/translations/en_EN.UTF-8/LC_MESSAGES/itech.mo', 'en_EN.UTF-8');
}