Skip to content
This repository
Browse code

MINOR Added array fallback support to i18nSSLegacyAdapter

  • Loading branch information...
commit 326ff4a78334ae5ad87d49bab374df91d37a59ce 1 parent 0e0e5dd
Ingo Schommer authored December 04, 2011

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. 8  i18n/i18nSSLegacyAdapter.php
8  i18n/i18nSSLegacyAdapter.php
@@ -19,21 +19,23 @@ public function __construct($options = array()) {
19 19
 		parent::__construct($options);
20 20
 	}
21 21
 	
22  
-	protected function _loadTranslationData($filename, $locale, array $options = array()) {   
  22
+	protected function _loadTranslationData($data, $locale, array $options = array()) {   
23 23
 		$options = array_merge($this->_options, $options);
24 24
 
25 25
 		if ($options['clear']  ||  !isset($this->_translate[$locale])) {
26 26
 			$this->_translate[$locale] = array();
27 27
 		}
28 28
 
29  
-		$this->_filename = $filename;
  29
+		if(is_array($data)) return array($locale => $data);
  30
+
  31
+		$this->_filename = $data;
30 32
 		
31 33
 		// Ignore files with other extensions
32 34
 		if(pathinfo($this->_filename, PATHINFO_EXTENSION) != 'php') return;
33 35
 		
34 36
 		if (!is_readable($this->_filename)) {
35 37
 			require_once 'Zend/Translate/Exception.php';
36  
-			throw new Zend_Translate_Exception('Error opening translation file \'' . $filename . '\'.');
  38
+			throw new Zend_Translate_Exception('Error opening translation file \'' . $this->_filename . '\'.');
37 39
 		}
38 40
 
39 41
 		global $lang;

0 notes on commit 326ff4a

Please sign in to comment.
Something went wrong with that request. Please try again.