From 04fc4e08cbc5c651130a283fd532d70c646c2e75 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 19 Nov 2005 00:11:11 +0000 Subject: --- framework/Exceptions/TException.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'framework/Exceptions/TException.php') 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 -- cgit v1.2.3