49 lines
931 B
PHP
49 lines
931 B
PHP
<?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');
|
|
// require_once('/Gettext/gettext.inc');
|
|
require_once(PROJECT_DIR .'/gettext.inc');
|
|
|
|
$supported_locales = array('fr_FR', 'en_US');
|
|
$encoding = 'UTF-8';
|
|
|
|
/*
|
|
$locale = (isset($_SESSION['p_lang']))? $_SESSION['p_lang'] : DEFAULT_LOCALE;
|
|
|
|
$locale = 'en_US';
|
|
*/
|
|
|
|
if (isset($_SESSION['p_lang']))
|
|
{
|
|
$locale = $_SESSION['p_lang'];
|
|
}
|
|
else
|
|
{
|
|
$locale = DEFAULT_LOCALE;
|
|
}
|
|
|
|
|
|
|
|
// gettext setup
|
|
T_setlocale(LC_MESSAGES, $locale);
|
|
|
|
$domain = 'messages';
|
|
|
|
bindtextdomain($domain, LOCALE_DIR);
|
|
|
|
// bind_textdomain_codeset is supported only in PHP 4.2.0+
|
|
if (function_exists('bind_textdomain_codeset'))
|
|
bind_textdomain_codeset($domain, $encoding);
|
|
|
|
textdomain($domain);
|
|
|
|
//header("Content-type: text/html; charset=$encoding");
|
|
|
|
?>
|