move function startup_gettext

This commit is contained in:
Andrew Dolgov 2007-03-06 11:33:06 +01:00
parent 3fb00ee0a2
commit aba609e088
2 changed files with 14 additions and 13 deletions

View File

@ -11,6 +11,19 @@
require_once 'config.php';
function startup_gettext() {
# Get locale from Accept-Language header
$lang = al2gt(array("en_US", "ru_RU"), "text/html");
if ($lang) {
_setlocale(LC_MESSAGES, $lang);
_bindtextdomain("messages", "locale");
_textdomain("messages");
_bind_textdomain_codeset("messages", "UTF-8");
}
}
if (ENABLE_TRANSLATIONS == true) {
startup_gettext();
}
@ -3203,19 +3216,6 @@
return print format_warning($msg);
}
function startup_gettext() {
# Get locale from Accept-Language header
$lang = al2gt(array("en_US", "ru_RU"), "text/html");
if ($lang) {
_setlocale(LC_MESSAGES, $lang);
_bindtextdomain("messages", "locale");
_textdomain("messages");
_bind_textdomain_codeset("messages", "UTF-8");
}
}
function T_sprintf() {
$args = func_get_args();
return vsprintf(__(array_shift($args)), $args);

View File

@ -4,6 +4,7 @@
// continuously
define('DEFAULT_ERROR_LEVEL', E_ALL);
error_reporting(E_ALL);
declare(ticks = 1);