]> git.wh0rd.org - tt-rss.git/commitdiff
do not reference gettext modules if ENABLE_TRANSLATIONS is disabled
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 19 May 2007 04:46:29 +0000 (05:46 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 19 May 2007 04:46:29 +0000 (05:46 +0100)
backend.php
functions.php

index 9b28f650eacb8b47bd143249043d2c30639a6a91..3b5c071c4a2c7218d035cf72d142c4cbf39482b3 100644 (file)
        require_once "functions.php";
 
        no_cache_incantation();
-       startup_gettext();
+
+       if (ENABLE_TRANSLATIONS == true) { 
+               startup_gettext();
+       }
 
        $script_started = getmicrotime();
 
index 62f0cdd028a0926eb8df4bd0568f69fc26fabbe6..568c13995bdfe340f181658767e2900a59e62bba 100644 (file)
@@ -6,25 +6,36 @@
                define('DEFAULT_ERROR_LEVEL', E_ERROR | E_WARNING | E_PARSE);
        } */
 
-       require_once "accept-to-gettext.php";
-       require_once "gettext/gettext.inc";
+       if (ENABLE_TRANSLATIONS == true) { 
+               require_once "accept-to-gettext.php";
+               require_once "gettext/gettext.inc";
+       } else {
+               function __($msg) {
+                       return $msg;
+               }
+               function startup_gettext() {
+                       // no-op
+                       return true;
+               }
+       }
 
        require_once 'config.php';
 
-       function startup_gettext() {
-
-               # Get locale from Accept-Language header
-               $lang = al2gt(array("en_US", "ru_RU"), "text/html");
+       if (ENABLE_TRANSLATIONS == true) { 
 
-               if ($lang) {
-                       _setlocale(LC_MESSAGES, $lang);
-                       _bindtextdomain("messages", "locale");
-                       _textdomain("messages");
-                       _bind_textdomain_codeset("messages", "UTF-8");
+               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();
        }