mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-03 00:07:58 +02:00
MINOR Better error handling in i18n::get_language_name()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@107437 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f9ea2613e6
commit
fcd9858271
@ -1555,7 +1555,11 @@ class i18n extends Object {
|
|||||||
*/
|
*/
|
||||||
static function get_language_name($code, $native = false) {
|
static function get_language_name($code, $native = false) {
|
||||||
$langs = self::$common_languages;
|
$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