summaryrefslogtreecommitdiff
path: root/framework/Exceptions
diff options
context:
space:
mode:
authorxue <>2005-11-19 02:42:35 +0000
committerxue <>2005-11-19 02:42:35 +0000
commitbc1a7e1e3a67537189d30013ea6d5fa4bf98e8e4 (patch)
treecf4505fc457292ed5499b16d2412bd00ab14a0bd /framework/Exceptions
parentc2b0b3123d351e1ec96203eb099e35c6d5c6bdc9 (diff)
Diffstat (limited to 'framework/Exceptions')
-rw-r--r--framework/Exceptions/TErrorHandler.php8
-rw-r--r--framework/Exceptions/TException.php4
-rw-r--r--framework/Exceptions/messages.txt2
3 files changed, 4 insertions, 10 deletions
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'].' <a href="http://www.pradosoft.com/">PRADO</a>/'.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.