How to get content language abbreviation ("en" instead of "English") in a View? Im trying to get the content language abbreviation in a view, when I select "content: Language" field then it shows me "English" but I need to get its abbreviation "en", I though there was an option in the view field but there isn't.
Assuming this is the language of a node. It should actually be stored in the database as en, es, etc and then being rendered.

To get the content from the database without it being rendered here are the steps.


Go to your view. Here's a sample one I'm using:  
Check the Information link on the bottom right hand side.  





When you click it, you should see a screen like so:





Here my two fields are listed as well as two other parts of the view where different things are occurring.
The names on the right hand side are different overrides you can implement to intercept the process of generating the display.  Depending on the name is the precedence. The further a name, the more specific it is.
Now, you need to decide how specific you want your change to be. I think using something like views-view-field--testlang--language.tpl.php is good. In my example, testlang is the name of the view and language the name of the field.
Click on the link next to the name of the field you want to override. It might be something like Field Content: Language (ID: language):. Once you have this, copy the content it's showing you.


Now that you have the name and the content of the field, go to your theme and create a file with the name you selected. If you have a templates folder on your theme, put it there.

Paste the code that your website generated for you,

&lt;?php

/**
 * @file
 * This template is used to print a single field in a view.
 *
 * It is not actually used in default Views, as this is registered as a theme
 * function which has better performance. For single overrides, the template is
 * perfectly okay.
 *
 * Variables available:
 * - $view: The view object
 * - $field: The field handler object that can process the input
 * - $row: The raw SQL result that can be used
 * - $output: The processed output that will normally be used.
 *
 * When fetching output from the $row, this construct should be used:
 * $data = $row-&gt;{$field-&gt;field_alias}
 *
 * The above will guarantee that you'll always get the correct data,
 * regardless of any changes in the aliasing that might happen if
 * the view is modified.
 */
?&gt;
&lt;?php print $output; ?&gt;


And now you modify it. 

At the top you can see that you have the following variables available: $view, $field, $row, $output. The $row variable is the SQL result.
This is why I asked where you how it's stored on the database. I'm assuming up to now, we are using a node's language.

Well, if you take that &lt;?php print $output; ?&gt; and change it for &lt;?php var_dump($row); ?&gt;, it will give you the result from the database. If now you go to where you view is shown, or to the preview, you should see a line with something similar to:

object(stdClass)[94]
  public 'node_title' =&gt; string 'Consequat Nostrud Occuro Quadrum' (length=32)
  public 'nid' =&gt; string '26' (length=2)
  public 'node_language' =&gt; string 'es' (length=2)
  public 'node_created' =&gt; string '1479304373' (length=10).

Now, if you change your line to: &lt;?php print $row-&gt;node_language; ?&gt;, it should print the value as it's stored in the database in 2 letter country codes.



Good luck! Hope this helps.