mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-17 22:51:29 +00:00
move function startup_gettext
This commit is contained in:
@@ -11,6 +11,19 @@
|
|||||||
|
|
||||||
require_once 'config.php';
|
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) {
|
if (ENABLE_TRANSLATIONS == true) {
|
||||||
startup_gettext();
|
startup_gettext();
|
||||||
}
|
}
|
||||||
@@ -3203,19 +3216,6 @@
|
|||||||
return print format_warning($msg);
|
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() {
|
function T_sprintf() {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
return vsprintf(__(array_shift($args)), $args);
|
return vsprintf(__(array_shift($args)), $args);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
// continuously
|
// continuously
|
||||||
|
|
||||||
define('DEFAULT_ERROR_LEVEL', E_ALL);
|
define('DEFAULT_ERROR_LEVEL', E_ALL);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
declare(ticks = 1);
|
declare(ticks = 1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user