@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | if(in_array($clean_url_language_code,$this->languages_iso_codes)) { |
| 83 | 83 | return $clean_url_language_code; |
| 84 | - } |
|
| 85 | - else if (in_array($not_clean_url_language_code,$this->languages_iso_codes)){ |
|
| 84 | + } else if (in_array($not_clean_url_language_code,$this->languages_iso_codes)){ |
|
| 86 | 85 | return $not_clean_url_language_code; |
| 86 | + } else { |
|
| 87 | + return $this->multilingual_parameters['default_language']; |
|
| 87 | 88 | } |
| 88 | - else return $this->multilingual_parameters['default_language']; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | if(isset($this->translations[$target][$this->multilingual_parameters['default_language']])){ |
| 101 | 101 | $target = $this->translations[$target][$this->languageDetection()]; |
| 102 | 102 | return $target; |
| 103 | - } |
|
| 104 | - elseif (isset($this->translations[$target])) { |
|
| 103 | + } elseif (isset($this->translations[$target])) { |
|
| 105 | 104 | return $target; |
| 105 | + } else { |
|
| 106 | + throw new \Exception ("The text '$target'' is not defined in '$translations' translation file."); |
|
| 106 | 107 | } |
| 107 | - else throw new \Exception ("The text '$target'' is not defined in '$translations' translation file."); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |