summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-03-18 19:25:06 +0300
committerAndrew Dolgov <[email protected]>2011-03-18 19:25:06 +0300
commit7b26a148b0fcd904ea5425fd5d317b53704822dc (patch)
treee1c64dd9c6ca4cbe8c74799d10cd5a5be0bf70b5 /functions.php
parent565ca5653c6ee1c2547a9b478cd8084fa3d825c9 (diff)
config: remove ENABLE_TRANSLATIONS
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php75
1 files changed, 31 insertions, 44 deletions
diff --git a/functions.php b/functions.php
index 1e9e5a576..2fe066f25 100644
--- a/functions.php
+++ b/functions.php
@@ -42,60 +42,47 @@
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;