summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-05-19 05:46:29 +0100
committerAndrew Dolgov <[email protected]>2007-05-19 05:46:29 +0100
commit8d03971834c105112909753af12bbc066709165f (patch)
tree4a5d827d382329bf47bc57ed31a079b7e2e8975b /functions.php
parentc4b0f96c817a5177a0cd467a0576d428ec20ed12 (diff)
do not reference gettext modules if ENABLE_TRANSLATIONS is disabled
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php37
1 files changed, 24 insertions, 13 deletions
diff --git a/functions.php b/functions.php
index 62f0cdd02..568c13995 100644
--- a/functions.php
+++ b/functions.php
@@ -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();
}