I got feedapi_languagedetect working, and on cron, I see some messages like this:

# The following languages were detected: 25 en.
# The following languages were detected: 7 en, 1 cs, 1 de, 1 nl.
# The following languages were detected: 6 en, 1 nl, 1 da, 1 pl, 1 de.

A question, where is the language information stored? Feed Element Mapper does not show a field where I can map languages to taxonomy as such.

Any help is appreciated.

Comments

deltab’s picture

I am asking this because the "language" field in node table is empty, so i suspect the mapper is not storing the language after detection.

acreibo’s picture

You could use feedapi_mapper_feedapi_languagedetect.inc. You would have to copy it to feedapi_mapper/mappers/ directory. Alternatively you could also insert one line in feedapi_node.module:

$feed_node = node_load($feed_nid);
$node->title = $feed_item->title;
$node->body = $feed_item->description;
$node->language = $feed_item->language;
$node->teaser = node_teaser($feed_item->description);

Hope this helps.

Christian

acreibo’s picture

If you use feedapi_mapper you have to set the mapping in the configuration of the feed too.

deltab’s picture

@acreibo, thanks, I have feedapi_mapper_feedapi_languagedetect.inc, but the UI doesn't show a mapping field, and nothing is mapped.

I tried the feedapi_node.module rectification, and it works very well, however, is there a way of fixing feedapi_mapper_feedapi_languagedetect.inc itself to get this working as expected? feedapi_node.module is not really a part of the FeedAPI Language Detector, so perhaps it'll work better if the .inc were fixed.

Many thanks.

deltab’s picture

@acreibo, for the new version of FeedAPI, how do I make the change? as follows?

$feed_node = node_load($feed_nid);
// Only call feedapi_mapper_map() directly in the case of FeedAPI Mapper 2.x
if (function_exists('feedapi_mapper_map') && function_exists('feedapi_mapper_unique')) {
$node = feedapi_mapper_map($feed_node, 'feedapi_node', $feed_item, $node);
}
else {
$type = node_get_types('type', $node->type);
if ($type->has_title) {
$node->title = $feed_item->title;
}
if ($type->has_body) {
$node->body = $feed_item->description;
}
}
$node->language = $feed_item->language;
$node->format = isset($settings['input_format']) ? $settings['input_format'] : FILTER_FORMAT_DEFAULT;
$node->teaser = node_teaser($feed_item->description);

tekken’s picture

subscribing.

bump.....