I haven't been able to figure out a way to set the default language per content type - there are some cases (like for nodes created by RSS feeds) where I need a type to default to say French rather than the site-wide default of English.

Ideas?

Qasim

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iamEAP’s picture

Category: Support request » Feature request
Status: Active » Needs review
FileSize
3.55 KB

I've found a need for this too. I'm attaching a patch which enables this functionality.

A couple of notes for people reviewing:

  • Why name the new variable i18n_node_default_language_for[node_type]? Because there's already a variable called i18n_node_default_language_none. If we removed the _for portion of the new variable name, it would be possible for the variable name to collide with a content type with machine name none.
  • Why not just add a custom option to the i18n_node_options_[node_type]variable? Because the behavior for "custom" and "current" are not mutually exclusive. If you were to select both, what would the behavior be? We can avoid that confusion by taking over the existing "current" value and displaying a new field in the event that it's checked. I've defaulted its value to effectively mean "current language," maintaining API backward compatibility.

Status: Needs review » Needs work

The last submitted patch, 1: i18n-custom_default_language_per_node_type-2320183-2.patch, failed testing.

The last submitted patch, 1: i18n-custom_default_language_per_node_type-2320183-2.patch, failed testing.

iamEAP’s picture

Status: Needs work » Needs review

Hmm. Test fails look totally unrelated to this patch. The latest 7.x-1.x-dev branch test hasn't run since December, so I'm not confident HEAD is working to begin with. Moving back to needs review manually.

joseph.olstad’s picture

queued for re-test

joseph.olstad’s picture

I like this functionality, would be nice to have some extra feedback from the community. I'll probably be using this on my own projects soon.

joseph.olstad’s picture

I just triggerred a few test runs. php 5.6, php 5.3 , php 7

joseph.olstad’s picture

nice looking patch, haven't had a chance to test it yet. The php 5.6 test result can safely be ignored. something with the test environment for 5.6 that causes the single fail.

jollysolutions’s picture

Status: Needs review » Reviewed & tested by the community

  • iamEAP authored 8cc0c95 on 7.x-1.x
    Issue #2320183 by iamEAP: Default Language per content type
    
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.