summaryrefslogtreecommitdiff
path: root/framework/Exceptions/TException.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Exceptions/TException.php')
-rw-r--r--framework/Exceptions/TException.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/framework/Exceptions/TException.php b/framework/Exceptions/TException.php
index a90c14dd..d920f373 100644
--- a/framework/Exceptions/TException.php
+++ b/framework/Exceptions/TException.php
@@ -51,10 +51,12 @@ class TException extends Exception
protected function translateErrorMessage($key)
{
- $languages=Prado::getUserLanguages();
- $msgFile=dirname(__FILE__).'/messages.'.$languages[0];
+ $lang=array_shift(explode('-',array_shift(Prado::getUserLanguages())));
+ if(!empty($lang) && !ctype_alpha($lang))
+ $lang='';
+ $msgFile=dirname(__FILE__).'/messages-'.$lang.'.txt';
if(!is_file($msgFile))
- $msgFile=dirname(__FILE__).'/messages.en';
+ $msgFile=dirname(__FILE__).'/messages.txt';
if(($entries=@file($msgFile))===false)
return $key;
else