From bc1a7e1e3a67537189d30013ea6d5fa4bf98e8e4 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 19 Nov 2005 02:42:35 +0000 Subject: --- framework/Exceptions/TErrorHandler.php | 8 ++------ framework/Exceptions/TException.php | 4 +--- framework/Exceptions/messages.txt | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'framework/Exceptions') diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index b5919e5d..52ed9935 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -92,9 +92,7 @@ class TErrorHandler extends TComponent implements IModule if($this->_templatePath===null) $this->_templatePath=dirname(__FILE__); $base=$this->_templatePath.'/'.self::ERROR_FILE_NAME; - $lang=array_shift(explode('-',array_shift(Prado::getUserLanguages()))); - if(!empty($lang) && !ctype_alpha($lang)) - $lang=''; + $lang=Prado::getPreferredLanguage(); if(is_file("$base$statusCode-$lang.html")) $errorFile="$base$statusCode-$lang.html"; else if(is_file("$base$statusCode.html")) @@ -175,9 +173,7 @@ class TErrorHandler extends TComponent implements IModule $_SERVER['SERVER_SOFTWARE'].' PRADO/'.Prado::getVersion(), strftime('%Y-%m-%d %H:%m',time()) ); - $lang=array_shift(explode('-',array_shift(Prado::getUserLanguages()))); - if(!empty($lang) && !ctype_alpha($lang)) - $lang=''; + $lang=Prado::getPreferredLanguage(); $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.html'; if(!is_file($exceptionFile)) $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'.html'; diff --git a/framework/Exceptions/TException.php b/framework/Exceptions/TException.php index d920f373..84ff1b89 100644 --- a/framework/Exceptions/TException.php +++ b/framework/Exceptions/TException.php @@ -51,9 +51,7 @@ class TException extends Exception protected function translateErrorMessage($key) { - $lang=array_shift(explode('-',array_shift(Prado::getUserLanguages()))); - if(!empty($lang) && !ctype_alpha($lang)) - $lang=''; + $lang=Prado::getPreferredLanguage(); $msgFile=dirname(__FILE__).'/messages-'.$lang.'.txt'; if(!is_file($msgFile)) $msgFile=dirname(__FILE__).'/messages.txt'; diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index b71b733f..e808938c 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -39,7 +39,7 @@ httpsession_gcprobability_invalid = THttpSession.GCProbability must be an integ httpsession_transid_unchangeable = THttpSession.UseTransparentSessionID cannot be modified after the session is started. httpsession_maxlifetime_unchangeable = THttpSession.Timeout cannot be modified after the session is started. -assetmanager_basepath_invalid = TAssetManager.BasePath '%s' is invalid. Make sure the directory exists and is writable by the Web server process. +assetmanager_basepath_invalid = TAssetManager.BasePath '%s' is invalid. Make sure it is in namespace form and points to a directory writable by the Web server process. assetmanager_basepath_unchangeable = TAssetManager.BasePath cannot be modified after the module is initialized. assetmanager_baseurl_unchangeable = TAssetManager.BaseUrl cannot be modified after the module is initialized. -- cgit v1.2.3