function lingotek_config_add_existing_translations in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lingotek.config.inc \lingotek_config_add_existing_translations()
1 call to lingotek_config_add_existing_translations()
File
- ./
lingotek.config.inc, line 73 - Config grid form elements
Code
function lingotek_config_add_existing_translations($lids, $lang_codes) {
$query = db_select('locales_target', 'lt')
->fields('lt', array(
'lid',
'language',
));
$query
->condition('lid', $lids, 'IN');
$result = $query
->execute()
->fetchAll();
$existing_translations = array();
foreach ($result as $key => $value) {
$lang = Lingotek::convertDrupal2Lingotek($value->language);
// This check is performed in lang_icons anyway so you might remove it
if ($lang && array_key_exists($lang, $lang_codes)) {
$existing_translations[$value->lid][] = Lingotek::convertDrupal2Lingotek($value->language);
}
}
return $existing_translations;
}