Changed loading of language files, now english files are loaded first.

If another language is configured, the translation is loaded after the english language files.
By using this method, you are able to use older translations with newer phpLogCon versions,
without having display issues. Strings which are not translated are just shown in english.
This commit is contained in:
Andre Lorbach 2009-01-26 15:47:28 +01:00
parent 6d21099ce0
commit 9cbe8a39c5
2 changed files with 21 additions and 4 deletions

View File

@ -712,7 +712,10 @@ class LogStreamPDO extends LogStream {
return ERROR_DB_QUERYFAILED;
if ( $this->_myDBQuery->rowCount() == 0 )
{
$this->_myDBQuery = null;
return ERROR_NOMORERECORDS;
}
// Initialize Array variable
$aResult = array();
@ -728,6 +731,9 @@ class LogStreamPDO extends LogStream {
}
}
// Delete handle
$this->_myDBQuery = null;
// return finished array
if ( count($aResult) > 0 )
return $aResult;

View File

@ -1031,12 +1031,23 @@ function IncludeLanguageFile( $langfile )
{
global $LANG, $LANG_EN;
if ( file_exists( $langfile ) )
include( $langfile );
// If english is not selected, we load ENGLISH first - then overwrite with configured language
if ( $LANG != "en" )
$langengfile = str_replace( $LANG, $LANG_EN, $langfile );
else
$langengfile = $langfile;
if ( file_exists($langengfile) )
include( $langengfile );
else
DieWithErrorMsg( "FATAL Error initialzing sublanguage system. Please make sure that all files have been uploaded correctly." );
// If nto english, load the additional translations
if ( $LANG != "en" )
{
$langfile = str_replace( $LANG, $LANG_EN, $langfile );
include( $langfile );
if ( file_exists( $langfile ) )
include( $langfile );
else
OutputDebugMessage("FATAL Error reading the configured language $LANG. Please make sure that all files have been uploaded correctly.", DEBUG_ERROR);
}
}