From 682f7ef6933f4ad485baedddf7a30367d003d7bf Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 25 Jan 2007 05:49:22 +0000 Subject: Fixed #502 --- framework/I18N/core/CultureInfo.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'framework/I18N/core/CultureInfo.php') diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php index bcf2f245..404c81fe 100644 --- a/framework/I18N/core/CultureInfo.php +++ b/framework/I18N/core/CultureInfo.php @@ -414,7 +414,7 @@ class CultureInfo * Gets the culture name in English. * Returns array('Language','Country'); * 'Country' is omitted if the culture is neutral. - * @return array array with language and country as elements. + * @return string language (country), it may locale code string if english name does not exist. */ function getEnglishName() { @@ -423,6 +423,9 @@ class CultureInfo $culture = $this->getInvariantCulture(); $language = $culture->findInfo("Languages/{$lang}"); + if(count($language) == 0) + return $this->culture; + $region = $culture->findInfo("Countries/{$reg}"); if($region) return $language[0].' ('.$region[0].')'; -- cgit v1.2.3