Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Added array fallback support to i18nSSLegacyAdapter

  • Loading branch information...
commit 326ff4a78334ae5ad87d49bab374df91d37a59ce 1 parent 0e0e5dd
Ingo Schommer chillu authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 i18n/i18nSSLegacyAdapter.php
8 i18n/i18nSSLegacyAdapter.php
View
@@ -19,21 +19,23 @@ public function __construct($options = array()) {
parent::__construct($options);
}
- protected function _loadTranslationData($filename, $locale, array $options = array()) {
+ protected function _loadTranslationData($data, $locale, array $options = array()) {
$options = array_merge($this->_options, $options);
if ($options['clear'] || !isset($this->_translate[$locale])) {
$this->_translate[$locale] = array();
}
- $this->_filename = $filename;
+ if(is_array($data)) return array($locale => $data);
+
+ $this->_filename = $data;
// Ignore files with other extensions
if(pathinfo($this->_filename, PATHINFO_EXTENSION) != 'php') return;
if (!is_readable($this->_filename)) {
require_once 'Zend/Translate/Exception.php';
- throw new Zend_Translate_Exception('Error opening translation file \'' . $filename . '\'.');
+ throw new Zend_Translate_Exception('Error opening translation file \'' . $this->_filename . '\'.');
}
global $lang;
Please sign in to comment.
Something went wrong with that request. Please try again.