Permalink
Browse files

MINOR Added array fallback support to i18nSSLegacyAdapter

  • Loading branch information...
1 parent 0e0e5dd commit 326ff4a78334ae5ad87d49bab374df91d37a59ce @chillu chillu committed Dec 4, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 i18n/i18nSSLegacyAdapter.php
View
8 i18n/i18nSSLegacyAdapter.php
@@ -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;

0 comments on commit 326ff4a

Please sign in to comment.