summaryrefslogtreecommitdiff
path: root/framework/I18N
diff options
context:
space:
mode:
authorwei <>2007-01-25 05:49:22 +0000
committerwei <>2007-01-25 05:49:22 +0000
commit682f7ef6933f4ad485baedddf7a30367d003d7bf (patch)
treef0eb02ab8373f481b212b5406bfdb95e48b03b10 /framework/I18N
parent9b4174135679398eaed518db99f3c72545aa3876 (diff)
Fixed #502
Diffstat (limited to 'framework/I18N')
-rw-r--r--framework/I18N/core/CultureInfo.php5
1 files changed, 4 insertions, 1 deletions
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 <code>array('Language','Country');</code>
* '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].')';