38 lines
676 B
PHP
Executable File
38 lines
676 B
PHP
Executable File
<?php
|
|
|
|
error_reporting(E_ALL | E_STRICT);
|
|
|
|
define('PROJECT_DIR', realpath('../Gettext/'));
|
|
define('LOCALE_DIR', PROJECT_DIR .'/locale');
|
|
define('DEFAULT_LOCALE', 'fr_FR');
|
|
|
|
require_once('../Gettext/gettext.inc');
|
|
|
|
$supported_locales = array('fr_FR', 'en_US');
|
|
$encoding = 'UTF-8';
|
|
|
|
if (isset($_SESSION['lang']))
|
|
{
|
|
$locale = $_SESSION['lang'];
|
|
}
|
|
else
|
|
{
|
|
$locale = DEFAULT_LOCALE;
|
|
}
|
|
|
|
// gettext setup
|
|
T_setlocale(LC_MESSAGES, $locale);
|
|
|
|
$domain = 'messages';
|
|
|
|
bindtextdomain($domain, LOCALE_DIR);
|
|
|
|
if (function_exists('bind_textdomain_codeset'))
|
|
bind_textdomain_codeset($domain, $encoding);
|
|
|
|
textdomain($domain);
|
|
|
|
//header("Content-type: text/html; charset=$encoding");
|
|
|
|
?>
|