Browse Source

Add Fallback language support to en-us

Matthew Vale 9 years ago
parent
commit
b3e124eea1
1 changed files with 6 additions and 1 deletions
  1. 6 1
      resources/classes/text.php

+ 6 - 1
resources/classes/text.php

@@ -58,7 +58,12 @@ class text {
 		//reduce to specific language
 			if ($language_code != 'all') {
 				foreach($text as $key => $value) {
-					$text[$key] = $value[$language_code];
+					if(strlen($value[$language_code]) > 0) {
+						$text[$key] = $value[$language_code];
+					}else{
+						//fallback to en-us
+						$text[$key] = $value['en-us'];
+					}
 				}
 			}
 			if ($language_code != 'all') {