mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-12 03:26:50 +01:00
User language can be selected from settings screen
If there has been a change of language, set a bool flag for a reload later Save languageUser to file also on settings update realpath checking on language file name also, dies if fails
This commit is contained in:
@@ -41,12 +41,18 @@ If ($ICEcoderUserSettings["versionNo"] != $ICEcoderSettings["versionNo"]) {
|
||||
$ICEcoder = $ICEcoderSettings + $ICEcoderUserSettings;
|
||||
|
||||
// Include language file
|
||||
// Load English first as foundation
|
||||
include(dirname(__FILE__)."/../lang/english.php");
|
||||
$englishText = $text;
|
||||
// Load chosen language ontop to replace English
|
||||
include(dirname(__FILE__)."/../lang/english.php");
|
||||
$text = array_replace_recursive($englishText, $text);
|
||||
// Load base first as foundation
|
||||
if (strpos(str_replace("\\","/",realpath(dirname(__FILE__)."/../lang/".$ICEcoder['languageBase'])),str_replace("\\","/",realpath($ICEcoder['docRoot']))) !== 0) {
|
||||
die('Sorry, bad base language path');
|
||||
}
|
||||
if (strpos(str_replace("\\","/",realpath(dirname(__FILE__)."/../lang/".$ICEcoder['languageUser'])),str_replace("\\","/",realpath($ICEcoder['docRoot']))) !== 0) {
|
||||
die('Sorry, bad user language path');
|
||||
}
|
||||
include(dirname(__FILE__)."/../lang/".$ICEcoder['languageBase']);
|
||||
$baseText = $text;
|
||||
// Load chosen language ontop to replace base
|
||||
include(dirname(__FILE__)."/../lang/".$ICEcoder['languageUser']);
|
||||
$text = array_replace_recursive($baseText, $text);
|
||||
$_SESSION['text'] = $text;
|
||||
|
||||
// Login not required or we're in demo mode and have password set in our settings, log us straight in
|
||||
|
||||
Reference in New Issue
Block a user