initializing git repo
This commit is contained in:
commit
3df8fc53b8
86 changed files with 5649 additions and 0 deletions
68
includes/language.php
Executable file
68
includes/language.php
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
function LangStr2Html ( $String )
|
||||
{
|
||||
$String = nl2br(htmlspecialchars($String,ENT_QUOTES));
|
||||
|
||||
//umlauts
|
||||
$String = str_replace("ß","ß",$String);
|
||||
$String = str_replace("ä","ä",$String);
|
||||
$String = str_replace("ö","ö",$String);
|
||||
$String = str_replace("ü","ü",$String);
|
||||
$String = str_replace("Ä","Ä",$String);
|
||||
$String = str_replace("Ö","Ö",$String);
|
||||
$String = str_replace("Ü","Ü",$String);
|
||||
return $String;
|
||||
}
|
||||
|
||||
function LangSpellHtml ( $Sentence )
|
||||
{
|
||||
return LangStr2Html(LangSpell($Sentence));
|
||||
}
|
||||
|
||||
function LangSpell ( $Sentence )
|
||||
{
|
||||
global $GlobalLanguage;
|
||||
|
||||
$ReturnValue="";
|
||||
|
||||
if (file_exists("./languages/$GlobalLanguage.lng"))
|
||||
$Language = file ("./languages/$GlobalLanguage.lng");
|
||||
else
|
||||
{
|
||||
ErrorLog("[language.php] File \"./languages/$GlobalLanguage.lng\" not found!");
|
||||
}
|
||||
|
||||
foreach ( $Language as $i )
|
||||
{
|
||||
$FileSentence=explode("=",$i,2);
|
||||
if ( trim( $FileSentence[0] ) == $Sentence )
|
||||
{
|
||||
$ReturnValue=trim($FileSentence[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$ReturnValue)
|
||||
{
|
||||
ErrorLog("[$GlobalLanguage.lng] Sentence \"$Sentence\" not found!");
|
||||
$ReturnValue=$Sentence;
|
||||
}
|
||||
|
||||
return $ReturnValue;
|
||||
}
|
||||
|
||||
function LangGetAvailableLanguages ()
|
||||
{
|
||||
$ReturnValue=array();
|
||||
$DirList=scandir('./languages/');
|
||||
foreach ($DirList as $i)
|
||||
{
|
||||
$SplitString=explode(".",$i);
|
||||
if ($i[0]=="." || strtolower($SplitString[1])!="lng")
|
||||
continue;
|
||||
$ReturnValue[count($ReturnValue)]=$SplitString[0];
|
||||
}
|
||||
return $ReturnValue;
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue