diff options
author | Andrew Dolgov <[email protected]> | 2007-03-05 09:37:13 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-03-05 09:37:13 +0100 |
commit | 659468ebf0197e682cc70629c3b538e793e765a2 (patch) | |
tree | 75a4a19c03439b718fc90df0e7119b9c20cf851f /functions.php | |
parent | 439bbe63ef88e530ec538884207a31c57a55c560 (diff) |
add php-gettext, i18n stuff
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/functions.php b/functions.php index f714abc4a..2e97ddb2c 100644 --- a/functions.php +++ b/functions.php @@ -18,6 +18,9 @@ require_once "magpierss/rss_fetch.inc"; require_once 'magpierss/rss_utils.inc'; + require_once "accept-to-gettext.php"; + require_once "gettext/gettext.inc"; + function purge_feed($link, $feed_id, $purge_interval, $debug = false) { $rows = -1; @@ -3184,4 +3187,17 @@ <img src=\"images/sign_info.png\">$msg</div>"; } + 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"); + } + } + ?> |