summaryrefslogtreecommitdiff
path: root/includes/view/Sprache_view.php
blob: 88c7435c3020f6db9975e88c5bb9842e173cad8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?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'];
}
?>