From 7ca846467da923a2bd39ef3f554e26e1f589c85e Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 26 Jul 2007 01:21:43 +0000 Subject: Fixed #678. --- framework/I18N/core/CultureInfo.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'framework/I18N/core/CultureInfo.php') diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php index 404c81fe..15370ebe 100644 --- a/framework/I18N/core/CultureInfo.php +++ b/framework/I18N/core/CultureInfo.php @@ -200,6 +200,18 @@ class CultureInfo return '.dat'; } + /** + * Gets the CultureInfo that for this culture string + * @return CultureInfo invariant culture info is "en". + */ + public static function getInstance($culture) + { + static $instances = array(); + if(!isset($instances[$culture])) + $instances[$culture] = new CultureInfo($culture); + return $instances[$culture]; + } + /** * Determine if a given culture is valid. Simply checks that the * culture data exists. -- cgit v1.2.3