t('Feed node: Language'), 'description' => t('Language of the feed node.'), 'callback' => 'locale_feeds_get_source', ); } } /** * Callback, returns specific locale settings of the parent feed node. */ function locale_feeds_get_source(FeedsImportBatch $batch, $key) { if ($node = $batch->feedNode()) { return $node->language; } } /** * Implementation of hook_feeds_node_processor_targets_alter(). */ function locale_feeds_node_processor_targets_alter(&$targets, $content_type) { if (variable_get('language_content_type_'. $content_type, FALSE)) { $targets['language'] = array( 'name' => t('Language'), 'callback' => 'locale_feeds_set_target', 'description' => t('The language of the node.'), ); } } /** * Callback for mapping. */ function locale_feeds_set_target($node, $key, $language) { $node->language = $language; }