language cleanup
parent
aad54bfe88
commit
813751ac7a
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Load a string by key.
|
||||
*
|
||||
* @param string $textid
|
||||
* @param string $sprache
|
||||
*/
|
||||
function Sprache($textid, $sprache) {
|
||||
$sprache_source = sql_select("
|
||||
SELECT *
|
||||
FROM `Sprache`
|
||||
WHERE `TextID`='" . sql_escape($textid) . "'
|
||||
AND `Sprache`='" . sql_escape($sprache) . "'
|
||||
LIMIT 1
|
||||
");
|
||||
if ($sprache_source === false)
|
||||
return false;
|
||||
if (count($sprache_source) == 1)
|
||||
return $sprache_source[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
?>
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Names of available languages.
|
||||
*/
|
||||
$languages = array (
|
||||
'DE' => "Deutsch",
|
||||
'EN' => "English"
|
||||
);
|
||||
|
||||
/**
|
||||
* Display acutual translation of given text id.
|
||||
* @param string $TextID
|
||||
* @param bool $NoError
|
||||
* @return string
|
||||
*/
|
||||
function Get_Text($TextID, $NoError = false) {
|
||||
global $debug;
|
||||
|
||||
if (!isset ($_SESSION['Sprache']))
|
||||
$_SESSION['Sprache'] = "EN";
|
||||
if ($_SESSION['Sprache'] == "")
|
||||
$_SESSION['Sprache'] = "EN";
|
||||
if (isset ($_GET["SetLanguage"]))
|
||||
$_SESSION['Sprache'] = $_GET["SetLanguage"];
|
||||
|
||||
$sprache_source = Sprache($TextID, $_SESSION['Sprache']);
|
||||
if($sprache_source === false)
|
||||
engelsystem_error("Unable to load text key.");
|
||||
if($sprache_source == null) {
|
||||
if($NoError && !$debug)
|
||||
return "";
|
||||
return $TextID;
|
||||
}
|
||||
return $sprache_source['Text'];
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue