/**
* Fake the locale function.
*/
if (!function_exists('locale')) {
function locale_supported_languages($reset = FALSE, $getall = FALSE) {
return array(
'name' => array('xx' => 'String Overrides'),
'formula' => array('xx' => ''),
);
}
function locale($string) {
static $strings = array();
$strings = variable_get('locale_custom_strings_en', array());
if ($strings[$string]) {
return $strings[$string];
}
else {
return $string;
}
}
}
Basically String Overrides pretends that it is Locale module and does the translation without hitting the database. Because it uses the same variable format as the Drupal 6 core feature, when the site upgrades to Drupal 6 the hack is no longer necessary and the site becomes compatible with Locale module again. For anyone needing to change just a few words on their Drupal site, String Overrides is a great solution.
In Action

