====== getLanguage() ======

''string **getLanguage**()''

Determines which language the questionnaire is currently shown in. This function is particularly helpful if the participant is able to choose from different language versions at the beginning of the survey ([[:en:create:multilang|Multilingual Surveys]]).

The function returns the three letter language code as specified in  [[http://www.loc.gov/standards/iso639-2/php/code_list.php|ISO 639-2]]. The language code for your survey can be found in **Language Versions** -> **Manage Language Versions** (if your survey project has multiple language versions).


===== Examples =====

At the end of the questionnaire, the participants will be forwarded to different websites depending on the language version.

<code php>
if (getLanguage() == 'fre') {
  redirect('http://www.lexpress.fr/');
} else {
  redirect('http://www.sueddeutsche.de/');
}
</code>

The following PHP code sends -- depending on the language version -- one of two mailings after 14 days to resume the questionnaire (see ''[[:en:create:functions:buttonhide|buttonHide()]]'').


<code php>
if (caseTime('begin') < 24 * 3600) {
  if (getLanguage() == 'eng') {
    mailResume(false, 3, 14 * 24 * 3600);  // English version
  } else {
    mailResume(false, 4, 14 * 24 * 3600);  // German version
  }
  text('end1');
  buttonHide();
} else {
  goToPage('next');
}
</code>