$browserLocale = new Zend_Locale(); $language = $browserLocale->getBrowser(); echo "Preferred Language: ".$language['language']."
"; echo "Preferred Region: ".$language['region']."
";
$locale = new Zend_Locale(); $browserLocale = $locale->getBrowser(); $locale->setLocale($browserLocale['language'].'_'.$browserLocale['region']); Zend_Registry::set('Zend_Locale', $locale);In this example, the preferred language and region of the user's browser are used to set the locale for the application. The locale is then set in the Zend_Registry for use throughout the application. The package library used in these examples is the Zend Framework.