You are here

function i18n_node_get_lang in Internationalization 7

Same name and namespace in other branches
  1. 5.3 i18n.module \i18n_node_get_lang()
  2. 5 i18n.module \i18n_node_get_lang()
  3. 5.2 i18n.module \i18n_node_get_lang()
  4. 6 i18n.module \i18n_node_get_lang()

Get node language.

File

i18n_node/i18n_node.module, line 161
Internationalization (i18n) module - Node type handling

Code

function i18n_node_get_lang($nid, $default = '') {
  $lang = db_query('SELECT language FROM {node} WHERE nid = :nid', array(
    ':nid' => $nid,
  ))
    ->fetchField();
  return $lang ? $lang : $default;
}