function _node_registration_translations_for in Node registration 7
Fetches languages this source string has been translated into.
See also
_node_registration_send_email()
1 call to _node_registration_translations_for()
- _node_registration_translation_description_for in includes/
node_registration.forms.inc - Returns a pretty translation status text for the given source string.
File
- includes/
node_registration.forms.inc, line 599 - New registration forms. Public and admin.
Code
function _node_registration_translations_for($source_text, $textgroup = NULL) {
if (!module_exists('locale')) {
return array();
}
if ($textgroup === NULL) {
$textgroup = 'node_registration';
}
$translations =& drupal_static(__FUNCTION__, array());
$cid = md5($source_text . ':' . $textgroup);
$languages =& $translations[$cid];
if (!isset($languages)) {
$languages = db_query('
SELECT t.language
FROM {locales_source} s
JOIN {locales_target} t ON (s.lid = t.lid)
WHERE s.textgroup = ? AND context = ? AND source = ?
', array(
'default',
$textgroup,
$source_text,
))
->fetchCol();
}
return $languages;
}