summaryrefslogtreecommitdiff
path: root/framework/I18N/core/CultureInfo.php
diff options
context:
space:
mode:
authorwei <>2007-01-24 06:20:33 +0000
committerwei <>2007-01-24 06:20:33 +0000
commitd4d2da50c846c8b60f9b141d9f712d54f287e44b (patch)
treec21fafb34622db16f40904fd827ef03b1ecb1ab9 /framework/I18N/core/CultureInfo.php
parent69e7bf1c66b645a99f1b4dd73863244d28b9c5b8 (diff)
Fixed #505, #508
Diffstat (limited to 'framework/I18N/core/CultureInfo.php')
-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].')';