- Patch #407256 by Damien Tournoud: make t() more robust.

merge-requests/26/head
Dries Buytaert 2009-05-09 18:39:03 +00:00
parent bbe7b77475
commit 435c939f59
1 changed files with 4 additions and 1 deletions

View File

@ -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)) {