Changeset View
Changeset View
Standalone View
Standalone View
lib/file_locale.php
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | protected function get_language() | ||||
if (isset($aliases[$lang]) && ($alias = $aliases[$lang]) | if (isset($aliases[$lang]) && ($alias = $aliases[$lang]) | ||||
&& file_exists(__DIR__ . "/locale/$alias.php") | && file_exists(__DIR__ . "/locale/$alias.php") | ||||
) { | ) { | ||||
return $alias; | return $alias; | ||||
} | } | ||||
} | } | ||||
//Fall back to just return the language identifier for reuse by the editor | |||||
if (!empty($langs)) { | |||||
$lang = explode(';', $langs[0]); | |||||
$lang = $lang[0]; | |||||
$lang = str_replace('-', '_', $lang); | |||||
machniak: It is probably all right. These three lines are already executed in this file, so I see a room… | |||||
return $lang; | |||||
} | |||||
return null; | return null; | ||||
} | } | ||||
/** | /** | ||||
* Returns translation of defined label/message. | * Returns translation of defined label/message. | ||||
* | * | ||||
* @return string Translated string. | * @return string Translated string. | ||||
*/ | */ | ||||
Show All 24 Lines |
It is probably all right. These three lines are already executed in this file, so I see a room for improvement. I.e. set $fallback in the foreach loop above. Also, add space after //.