コード例 #1
0
ファイル: index.php プロジェクト: pontifechs/CORAL-Main
$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");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
コード例 #2
0
ファイル: directory.php プロジェクト: billdueber/resources
      <?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");