From 7c33dbd479df8b95c0ec05dcacad0666d9550194 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Dec 2008 08:13:09 +0100 Subject: translations support for mobile version --- functions.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index bb8586719..38b11c665 100644 --- a/functions.php +++ b/functions.php @@ -53,6 +53,12 @@ $lang = $_COOKIE["ttrss_lang"]; } + /* In login action of mobile version */ + if ($_POST["language"] && defined('MOBILE_VERSION')) { + $lang = $_POST["language"]; + $_COOKIE["ttrss_lang"] = $lang; + } + if ($lang) { if (defined('LC_MESSAGES')) { _setlocale(LC_MESSAGES, $lang); @@ -61,7 +67,13 @@ } else { die("can't setlocale(): please set ENABLE_TRANSLATIONS to false in config.php"); } - _bindtextdomain("messages", "locale"); + + if (defined('MOBILE_VERSION')) { + _bindtextdomain("messages", "../locale"); + } else { + _bindtextdomain("messages", "locale"); + } + _textdomain("messages"); _bind_textdomain_codeset("messages", "UTF-8"); } -- cgit v1.2.3-54-g00ecf