You are here

function og_set_language in Organic groups 6

Same name and namespace in other branches
  1. 6.2 og.module \og_set_language()

Set the language for the page based on group's language. Will have no effect if user has set a personal language.

Parameters

string $node : A group node object.

1 call to og_set_language()
og_init in ./og.module

File

./og.module, line 417

Code

function og_set_language($node) {
  if ($node->og_language) {
    $map = language_list();
    $og_language = $map[$node->og_language];
    $user_language = user_preferred_language($account, $og_language);
    if ($og_language == $user_language) {
      $GLOBALS['language'] = $og_language;
    }
  }
}