Hi,
I really like the new options for node language and "Require language (Do not allow Language Neutral)". I would like to be able to display something like <none> in the language selection field and still require language.

What happens is that some users don't check well all the fields when creating their nodes and it's hard to tell them to check well the language selection field. So the language selected may be the default website language or the language the user is in, but their text may be a different language. That would be great to have <none> by default so we are sure they select themselves a language, the right one.

Comments

jose reyero’s picture

Status: Active » Closed (won't fix)

Then someone would ask for a 'reasonable default' insteaed of 'none'. And worse we'll be changing behavior some existing sites alreay rely on.

I'm afraid you'll have to do some form_alter() for your site.

j0nathan’s picture

Title: "none" by default in the language selection field when creating a node » force to manualy select a language in node creation form
Category: feature » support
Priority: Normal » Minor
Status: Closed (won't fix) » Active

Hi Jose,

The idea is to force to manually select a language in node creation form and having <none> was a way I though to achieve this. I thought it could be a check box per content type like the other options for node language, like "Require language (Do not allow Language Neutral)". Having a check box, unchecked by default, shouldn't change the already configured behaviour.

I did tried with form_alter(), but I was not able. It always gave me the current language or the site's default language depending of the configuration "Set current language as default for new content". I am not so experienced in programming though.

Here is the code I tried.

function MYMODULE_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'page_node_form' || $form_id == 'blog_node_form') {
    $form['language']['#default_value'] = '';
  }
}

For the #default_value, I tried '' (nothing), 'NONE' and FALSE, without success.

Any help is welcomed.
Thanks

j0nathan’s picture

Priority: Minor » Normal

A post in the group Internationalization:

Force language on creating nodes
http://groups.drupal.org/node/84319

jose reyero’s picture

Component: Code » Blocks
Status: Active » Closed (fixed)

Cleaning old issues (> 1 year without follow up)

j0nathan’s picture

Status: Closed (fixed) » Closed (won't fix)

As I remember it was never fixed, but I don't need this anymore.