How to set Language for automatic nodes created from RSS
| Project: | Internationalization |
| Version: | 5.x-2.3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hi,
I don't know whether this is a bug report or a feature request, but here it is:
The Drigg module has an option to import RSS feeds from Drupal's core Aggregator module, and automatically convert them into drigg node types (i.e. Scoops). One can select the Section (taxonomy), Author (user) under whos name it will be published, and Tags (taxonomy).
I have a multilingual site running on 3 languages, so I use i18n. And when I enabled the Drigg RSS importer (for various blog entries around the internet to be converted into Scoops) there was instantly a problem because the new nodes didn't know which language they belong to. So it resulted in many red foreach errors. When I would go to Content and edit those new nodes they would be instantly published as soon as I would choose their language.
I have opened a Drigg issue here http://drupal.org/node/255993 , where I detail the problem and list the errors from the log. But I really think this is something that should be handled by i18 module, just like it handles the synchronization of many other parts of drupal.
The maintainer of Drigg module ( mercmobily ) has no idea about how to set this up, but with a little help from you guys he said he can do it. What is needed is information on which variables must he call from the i18n in order to correctly set the language selection for the RSS-to-Scoop converter.
I've attached the Drigg_rss.module (which is a sub-module of Drigg) .... please have a look at it (it's only 350 lines). The BIG question from i18n is: What exactly should be added to it in order for the language selection to work in the following logic: "IF i18n module exists, get the variables and present a language choice... and then, when the new node is created, set the language for that node according to the choice of that RSS".
Many-many thanks in advance for your help.
| Attachment | Size |
|---|---|
| drigg_rss.zip | 3.68 KB |

#1
Ok... it's been 3 weeks and no reply... BASICALLY, I need to insert a little i18n code inside Drigg RSS sub-module, so that when new nodes are created from RSS feeds it already knows which language that node belongs to. I don't know how i18n module works and therefore I don't know which variables to insert.
For instance some bloggers blog in English and other blog in French or Italian. Drigg RSS is able to import those feeds and automatically convert them into nodes with the chosen author and taxonomy. But as of now there is no way to choose which language that incoming new node is in. And on a multilingual site this causes the new nodes get "jammed" and not appear at all. -- Please Help!!! - Thank You!!
#2
I have a very similar problem
and have thought of a simpler solution but don't know how to implement it
it could potentially solve your problem drupalina
(if you agree to this solution we could change title to be more general)
My assumption is that each feed has a predefined language
Internationalization could assign a Preferred language for each content type
let say in admin/content/types/article under "Multilingual options"
and then for bilingual/multilingual sites the admin could create "Articles for Language 1"
with language 1 as Preferred language and "Articles for Language 2" with
Language 2 as preferred etc
Does anyone know how to implement this ??
#3
Your message and solution is not very clear.
I believe your assumption that each feed comes with a predefined language is wrong. At least the i18n module remains unresponsive to those languages in feeds.
When an RSS exporter module (in this case Drigg RSS) is creating new nodes from the aggregator feeds, on a miltilingual site it needs to tell which language it is in. In other words, it has to call some variables from i18n module, which will give admin the option to choose language for future nodes, just like the existing options that i18n gives in the new node submission form. But I don't know which variables are responsible for it...
This is why I'm waiting for the maintainers of the i18n to _please_ respond to this thread...
#4
Maybe I confused or maybe you did
my PROPOSED solution is pretty much what millete and Alex say
http://groups.drupal.org/node/11404#comment-38115
You create your multilingual feed
node/add/feedapi-node
SELECT THE LANGUAGE THERE
and all the nodes created from this feed
will ALL have the selected language set
exactly like nodeapi_inherit passes the
taxonomy terms to the feed-created nodes
Hope its clear now
#5
@ Giorgosk, sorry about the confusion. Yes, that is exactly what I have in mind.
The only slight difference is that in this issue I'm waiting for the maintainers of the i18n module to tell me exactly which variables are those, so that the developper of Drigg module can also implement this for the Drigg RSS module.