mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Better error handling in i18n::get_language_name() (from r107437)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112596 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f097b678d8
commit
ab918e8546
@ -1555,7 +1555,11 @@ class i18n extends Object {
|
||||
*/
|
||||
static function get_language_name($code, $native = false) {
|
||||
$langs = self::$common_languages;
|
||||
return ($native ? $langs[$code][1] : $langs[$code][0]);
|
||||
if($native) {
|
||||
return (isset($langs[$code][1])) ? $langs[$code][1] : false;
|
||||
} else {
|
||||
return (isset($langs[$code][0])) ? $langs[$code][0] : false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user