Example #1
0
<?php

//determine CORAL main path so we can check each module below to know which to display
$pagePath = $_SERVER["DOCUMENT_ROOT"];
$currentFile = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentFile);
for ($i = 0; $i < count($parts) - 1; $i++) {
    $pagePath .= $parts[$i] . '/';
}
session_start();
// Include file of language codes
include_once 'LangCodes.php';
$lang_name = new LangCodes();
// Verify the language of the browser
global $http_lang;
if (isset($_COOKIE["lang"])) {
    $http_lang = $_COOKIE["lang"];
} else {
    $codeL = str_replace("-", "_", substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 5));
    $http_lang = $lang_name->getLanguage($codeL);
    if ($http_lang == "") {
        $http_lang = "en_US";
    }
}
putenv("LC_ALL={$http_lang}");
setlocale(LC_ALL, $http_lang . ".utf8");
bindtextdomain("messages", dirname(__FILE__) . "/locale");
textdomain("messages");
?>

Example #2
0
      <?php 
            if ($key == 'attachments') {
                ?>
        <span class='span_AttachmentNumber smallGreyText' style='clear:right; margin-left:18px;'></span>
      <?php 
            }
            ?>
    </div>
    <?php 
        }
    }
}
function debug($value)
{
    echo '<pre>' . print_r($value, true) . '</pre>';
}
// Include file of language codes
include_once 'LangCodes.php';
$lang_name = new LangCodes();
// Verify the language of the browser
global $http_lang;
if (isset($_COOKIE["lang"])) {
    $http_lang = $_COOKIE["lang"];
} else {
    $codeL = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2);
    $http_lang = $lang_name->getLanguage($codeL);
}
putenv("LC_ALL={$http_lang}");
setlocale(LC_ALL, $http_lang . ".utf8");
bindtextdomain("messages", "./locale");
textdomain("messages");