4

Lock content language for user or role

http://drupal.org

I have a multilanguage site with users (autors) that can manage content only in one language.
A content type 'News' that I created has i18n's Language select on the bottom of create new News form.

I managed to get users language as selected option but I would like to lock this option down to preferred language for this user.

With hook_form_alter I can change $form['language']['#options'] to only one language but still displays all languages.

function newsalter_form_alter(&$form, $form_state, $form_id) {

  switch ($form_id) {

    case 'news_node_form':

     $form['language']['#options'] = array('ru' => 'Russian');
     //print_r($form);

     break;
  }
}

This does fill language options with only Russian but still displaying all languages.

Is there any other solution to hide unwanted languages or just lock this to one language and even not showing this select field?

Read »
Created by aaron 1 year 47 weeks ago
Category: News   Tags:

PSD to Drupal Theme

Drupal Development

Module Development

Get an Estimate

Tags for Lock content language for user or role

Recent comments