Voting starts in March for the Drupal Association Board election.
When creating a CSV-export of multi-lingual content using Views, the field "Content: Language" does not give the option to use the language code, but only the English or native name. This results in issues like this one, because the imported field does not contain the ISO code that Drupal recognizes as a valid language, but the language name.
Solutions would be possible in several modules:
- In Views (would make the most sense, as the data to be imported usually gets generated here): Make "Language code" available as one of the output options of "Content: Language" (see http://drupal.org/node/1222204).
- In Feeds: see http://drupal.org/node/840142 (since 2010).
The Feeds Tamper solution:
The solution here is provided in the form of a plugin. It simply replaces the language name with the corresponding code at import. If that fails or the language field is empty , "und" (undefined) will be used, resulting in "Language neutral".
Just rename the attached file to language_to_code.inc and place it in the modules/feeds_tamper/plugins folder.
After that a new plugin "Language to ISO code" is available, obviously to be applied on a field with English language names.
A more sophisticated piece of code might be possible using the Drupal API:
$languages = language_list('enabled');
that returns a list of installed languages. I didn't look into that.
Along the way I wrote a small reference article with a list of languages used in Drupal. Feel free to copy and paste it somewhere in the Drupal documentation (leave a cross-link here), as I couldn't find it there.