summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-09 18:39:03 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-09 18:39:03 +0000
commit435c939f59ed52d67f36cd893d0e202a1a0d1234 (patch)
tree689fb1fb459a3ce4bd6a844abb7ec6efe2fca8d8 /includes/common.inc
parentbbe7b77475964e5ad67a2fff9da07e820e699d4b (diff)
downloadbrdo-435c939f59ed52d67f36cd893d0e202a1a0d1234.tar.gz
brdo-435c939f59ed52d67f36cd893d0e202a1a0d1234.tar.bz2
- Patch #407256 by Damien Tournoud: make t() more robust.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 76637a4c7..a292c30cc 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1122,7 +1122,10 @@ function t($string, $args = array(), $langcode = NULL) {
$string = $custom_strings[$langcode][$string];
}
// Translate with locale module if enabled.
- elseif (function_exists('locale') && $langcode != 'en') {
+ // We don't use drupal_function_exists() here, because it breaks the testing
+ // framework if the locale module is enabled in the parent site (we cannot
+ // unload functions in PHP).
+ elseif (module_exists('locale') && $langcode != 'en') {
$string = locale($string, $langcode);
}
if (empty($args)) {