]> git.wh0rd.org Git - tt-rss.git/commitdiff
config: remove ENABLE_TRANSLATIONS
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 18 Mar 2011 16:25:06 +0000 (19:25 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 18 Mar 2011 16:25:06 +0000 (19:25 +0300)
backend.php
config.php-dist
functions.php
localized_js.php
localized_schema.php
login_form.php
sanity_config.php

index 016e1898687ac95168ca479651d7f50311e3bcd1..fd5ad6e7d5587f0e24a2d6c6aa15715ab66d4d3d 100644 (file)
@@ -24,9 +24,7 @@
 
        no_cache_incantation();
 
-       if (ENABLE_TRANSLATIONS == true) {
-               startup_gettext();
-       }
+       startup_gettext();
 
        $script_started = getmicrotime();
 
index 320787d7797616d2499f40ba8071a0c50a6bfcc6..2fd065a5e881e8913786bd58a9a47b87489f38fe 100644 (file)
@@ -82,9 +82,6 @@
        // If update daemon and update_feeds should send digests
        // Disable if you prefer querying special URL (see wiki)
 
-       define('ENABLE_TRANSLATIONS', true);
-       // Enable support for interface translations
-
        define('MYSQL_CHARSET', 'UTF8');
        // Connection charset for MySQL. If you have a legacy database and/or experience
        // garbage unicode characters with this option, try setting it to a blank string.
index 1e9e5a576701ae14ba5d10c253714052cf7677b7..2fe066f257f45f439bef71da53dfbc2b983815a0 100644 (file)
                return $tr;
        }
 
-       if (ENABLE_TRANSLATIONS == true) { // If translations are enabled.
-               require_once "lib/accept-to-gettext.php";
-               require_once "lib/gettext/gettext.inc";
+       require_once "lib/accept-to-gettext.php";
+       require_once "lib/gettext/gettext.inc";
 
-               function startup_gettext() {
+       function startup_gettext() {
 
-                       # Get locale from Accept-Language header
-                       $lang = al2gt(array_keys(get_translations()), "text/html");
+               # Get locale from Accept-Language header
+               $lang = al2gt(array_keys(get_translations()), "text/html");
 
-                       if (defined('_TRANSLATION_OVERRIDE_DEFAULT')) {
-                               $lang = _TRANSLATION_OVERRIDE_DEFAULT;
-                       }
-
-                       if ($_COOKIE["ttrss_lang"] && $_COOKIE["ttrss_lang"] != "auto") {
-                               $lang = $_COOKIE["ttrss_lang"];
-                       }
-
-                       /* In login action of mobile version */
-                       if ($_POST["language"] && defined('MOBILE_VERSION')) {
-                               $lang = $_POST["language"];
-                               $_COOKIE["ttrss_lang"] = $lang;
-                       }
+               if (defined('_TRANSLATION_OVERRIDE_DEFAULT')) {
+                       $lang = _TRANSLATION_OVERRIDE_DEFAULT;
+               }
 
-                       if ($lang) {
-                               if (defined('LC_MESSAGES')) {
-                                       _setlocale(LC_MESSAGES, $lang);
-                               } else if (defined('LC_ALL')) {
-                                       _setlocale(LC_ALL, $lang);
-                               } else {
-                                       die("can't setlocale(): please set ENABLE_TRANSLATIONS to false in config.php");
-                               }
+               if ($_COOKIE["ttrss_lang"] && $_COOKIE["ttrss_lang"] != "auto") {
+                       $lang = $_COOKIE["ttrss_lang"];
+               }
 
-                               if (defined('MOBILE_VERSION')) {
-                                       _bindtextdomain("messages", "../locale");
-                               } else {
-                                       _bindtextdomain("messages", "locale");
-                               }
+               /* In login action of mobile version */
+               if ($_POST["language"] && defined('MOBILE_VERSION')) {
+                       $lang = $_POST["language"];
+                       $_COOKIE["ttrss_lang"] = $lang;
+               }
 
-                               _textdomain("messages");
-                               _bind_textdomain_codeset("messages", "UTF-8");
+               if ($lang) {
+                       if (defined('LC_MESSAGES')) {
+                               _setlocale(LC_MESSAGES, $lang);
+                       } else if (defined('LC_ALL')) {
+                               _setlocale(LC_ALL, $lang);
                        }
-               }
 
-               startup_gettext();
+                       if (defined('MOBILE_VERSION')) {
+                               _bindtextdomain("messages", "../locale");
+                       } else {
+                               _bindtextdomain("messages", "locale");
+                       }
 
-       } else { // If translations are enabled.
-               function __($msg) {
-                       return $msg;
+                       _textdomain("messages");
+                       _bind_textdomain_codeset("messages", "UTF-8");
                }
-               function startup_gettext() {
-                       // no-op
-                       return true;
-               }
-       } // If translations are enabled.
+       }
+
+       startup_gettext();
 
        if (defined('MEMCACHE_SERVER')) {
                $memcache = new Memcache;
index 08eec1affda61182d9633c2ddcc4109fb2274585..e51e973176868023c94b264554c3e958065d6584 100644 (file)
@@ -3,7 +3,7 @@
 
        require "functions.php";
        header("Content-Type: text/plain; charset=UTF-8");
-       
+
        function T_js_decl($s1, $s2) {
                if ($s1 && $s2) {
                        $s1 = preg_replace("/\n/", "", $s1);
@@ -28,17 +28,12 @@ function __(msg) {
 }
 
 <?php
+       $l10n = _get_reader();
 
-       if (ENABLE_TRANSLATIONS) {
-
-               $l10n = _get_reader();
+       for ($i = 0; $i < $l10n->total; $i++) {
+               $orig = $l10n->get_original_string($i);
+               $translation = __($orig);
 
-               for ($i = 0; $i < $l10n->total; $i++) {
-                       $orig = $l10n->get_original_string($i);
-                       $translation = __($orig);
-       
-                       print T_js_decl($orig, $translation);
-               }
+               print T_js_decl($orig, $translation);
        }
-
 ?>
index fab7953e89f52e124425dbe69119ba093dc6bd76..0fe45855bc2f5f9a83c9145438349ba9a2170403 100644 (file)
@@ -1,4 +1,4 @@
-<?php # This file has been generated at:  Fri Mar 18 18:25:12 MSK 2011
+<?php # This file has been generated at:  Fri Mar 18 19:23:17 MSK 2011
 
 __("Title");
 __("Title or Content");
index 141f3f0bfe3c1b5841a9e3d8998e54fe2bd0f135..e7ec0a68bbe5f9e8b872d54a0154a9640ae2e795 100644 (file)
@@ -38,7 +38,7 @@ function fetchProfiles() {
        try {
                var params = Form.serialize('loginForm');
                var query = "?op=getProfiles&" + params;
-               
+
                if (query) {
                        new Ajax.Request("backend.php", {
                                parameters: query,
@@ -58,7 +58,7 @@ function fetchProfiles() {
 function languageChange(elem) {
        try {
                document.forms['loginForm']['click'].disabled = true;
-       
+
                var lang = elem[elem.selectedIndex].value;
                setCookie("ttrss_lang", lang, <?php print SESSION_COOKIE_LIFETIME ?>);
                window.location.reload();
@@ -76,7 +76,7 @@ function bwLimitChange(elem) {
        try {
                var limit_set = elem.checked;
 
-               setCookie("ttrss_bwlimit", limit_set, 
+               setCookie("ttrss_bwlimit", limit_set,
                        <?php print SESSION_COOKIE_LIFETIME ?>);
 
        } catch (e) {
@@ -129,14 +129,13 @@ function validateLoginForm(f) {
                <?php } ?>
                <table>
                        <tr><td align="right"><?php echo __("Login:") ?></td>
-                       <td align="right"><input name="login" 
+                       <td align="right"><input name="login"
                                onchange="fetchProfiles()" onfocus="fetchProfiles()"
                                value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
                        <tr><td align="right"><?php echo __("Password:") ?></td>
                        <td align="right"><input type="password" name="password"
                                onchange="fetchProfiles()" onfocus="fetchProfiles()"
                                value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
-                       <?php if (ENABLE_TRANSLATIONS) { ?>
                        <tr><td align="right"><?php echo __("Language:") ?></td>
                        <td align="right">
                        <?php
@@ -145,7 +144,6 @@ function validateLoginForm(f) {
 
                        ?>
                        </td></tr>
-                       <?php } ?>
 
                        <tr><td align="right"><?php echo __("Profile:") ?></td>
                        <td align="right" id="profile_box">
@@ -167,7 +165,7 @@ function validateLoginForm(f) {
                        <?php } ?>
 
                                <input type="hidden" name="action" value="login">
-                               <input type="hidden" name="rt" 
+                               <input type="hidden" name="rt"
                                        value="<?php if ($return_to != 'none') { echo $return_to; } ?>">
                        </td></tr>
 
@@ -188,7 +186,7 @@ function validateLoginForm(f) {
        <td align="center" class="loginBottom">
        <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
        <?php if (!defined('HIDE_VERSION')) { ?>
-                v<?php echo VERSION ?> 
+                v<?php echo VERSION ?>
        <?php } ?>
        &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
        </td>
index 7fafd2246da259c942dc66305aecb7047c35b08e..f41beff474f4bd722c1d23a08c8f85c6a772b10c 100644 (file)
@@ -1,3 +1,3 @@
-<?php # This file has been generated at:  Fri Mar 18 18:21:15 MSK 2011
+<?php # This file has been generated at:  Fri Mar 18 19:24:44 MSK 2011
 define('GENERATED_CONFIG_CHECK', 21);
-$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MAGPIE_FETCH_TIME_OUT', 'MAGPIE_CACHE_DIR', 'MAGPIE_CACHE_AGE', 'ICONS_DIR', 'ICONS_URL', 'SINGLE_USER_MODE', 'TMP_DIRECTORY', 'ENABLE_UPDATE_DAEMON', 'DAEMON_SLEEP_INTERVAL', 'DATABASE_BACKED_SESSIONS', 'SESSION_CHECK_ADDRESS', 'SESSION_COOKIE_LIFETIME', 'SESSION_EXPIRE_TIME', 'DAEMON_UPDATE_LOGIN_LIMIT', 'CHECK_FOR_NEW_VERSION', 'DIGEST_ENABLE', 'DIGEST_EMAIL_LIMIT', 'DAEMON_SENDS_DIGESTS', 'ENABLE_TRANSLATIONS', 'MYSQL_CHARSET', 'DEFAULT_UPDATE_METHOD', 'SIMPLEPIE_CACHE_DIR', 'SIMPLEPIE_CACHE_IMAGES', 'COUNTERS_MAX_AGE', 'DIGEST_FROM_NAME', 'DIGEST_FROM_ADDRESS', 'DIGEST_SUBJECT', 'DIGEST_SMTP_HOST', 'DIGEST_SMTP_LOGIN', 'DIGEST_SMTP_PASSWORD', 'DAEMON_FEED_LIMIT', 'ALLOW_REMOTE_USER_AUTH', 'AUTO_LOGIN', 'LOCK_DIRECTORY', 'ENABLE_GZIP_OUTPUT', 'PHP_EXECUTABLE', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'FEEDBACK_URL', 'FORCE_ARTICLE_PURGE', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_TWEET_BUTTON', 'CONSUMER_KEY', 'CONSUMER_SECRET', 'ISCONFIGURED', 'CONFIG_VERSION'); ?>
+$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MAGPIE_FETCH_TIME_OUT', 'MAGPIE_CACHE_DIR', 'MAGPIE_CACHE_AGE', 'ICONS_DIR', 'ICONS_URL', 'SINGLE_USER_MODE', 'TMP_DIRECTORY', 'ENABLE_UPDATE_DAEMON', 'DAEMON_SLEEP_INTERVAL', 'DATABASE_BACKED_SESSIONS', 'SESSION_CHECK_ADDRESS', 'SESSION_COOKIE_LIFETIME', 'SESSION_EXPIRE_TIME', 'DAEMON_UPDATE_LOGIN_LIMIT', 'CHECK_FOR_NEW_VERSION', 'DIGEST_ENABLE', 'DIGEST_EMAIL_LIMIT', 'DAEMON_SENDS_DIGESTS', 'MYSQL_CHARSET', 'DEFAULT_UPDATE_METHOD', 'SIMPLEPIE_CACHE_DIR', 'SIMPLEPIE_CACHE_IMAGES', 'COUNTERS_MAX_AGE', 'DIGEST_FROM_NAME', 'DIGEST_FROM_ADDRESS', 'DIGEST_SUBJECT', 'DIGEST_SMTP_HOST', 'DIGEST_SMTP_LOGIN', 'DIGEST_SMTP_PASSWORD', 'DAEMON_FEED_LIMIT', 'ALLOW_REMOTE_USER_AUTH', 'AUTO_LOGIN', 'LOCK_DIRECTORY', 'ENABLE_GZIP_OUTPUT', 'PHP_EXECUTABLE', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'FEEDBACK_URL', 'FORCE_ARTICLE_PURGE', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_TWEET_BUTTON', 'CONSUMER_KEY', 'CONSUMER_SECRET', 'ISCONFIGURED', 'CONFIG_VERSION'); ?>