protected function _getLanguage($sourceSurveyId, $language)
    {
        if (! is_string($language)) {
            $language = (string) $language;
        }

        if (! isset($this->_languageMap[$sourceSurveyId][$language])) {
            if ($language && $this->_isLanguage($sourceSurveyId, $language)) {
                $this->_languageMap[$sourceSurveyId][$language] = $language;
            } else {
                $lsDb = $this->getSourceDatabase();

                $sql = 'SELECT language
                    FROM ' . $this->_getSurveysTableName() . '
                    WHERE sid = ?';

                $this->_languageMap[$sourceSurveyId][$language] = $lsDb->fetchOne($sql, $sourceSurveyId);
            }
        }

        return $this->_languageMap[$sourceSurveyId][$language];
    }
protected function _getLanguage($sourceSurveyId, $language)
    {
        if (! is_string($language)) {
            $language = (string) $language;
        }

        if (! isset($this->_languageMap[$sourceSurveyId][$language])) {
            if ($language && $this->_isLanguage($sourceSurveyId, $language)) {
                $this->_languageMap[$sourceSurveyId][$language] = $language;
            } else {
                $lsDb = $this->getSourceDatabase();

                $sql = 'SELECT language
                    FROM ' . $this->_getSurveysTableName() . '
                    WHERE sid = ?';

                $this->_languageMap[$sourceSurveyId][$language] = $lsDb->fetchOne($sql, $sourceSurveyId);
            }
        }

        return $this->_languageMap[$sourceSurveyId][$language];
    }
protected function _getLanguage ( $ sourceSurveyId , $ language ) { if ( ! is_string ( $ language ) ) { $ language = ( string ) $ language ; } if ( ! isset ( $ this -> _languageMap [ $ sourceSurveyId ] [ $ language ] ) ) { if ( $ language && $ this -> _isLanguage ( $ sourceSurveyId , $ language ) ) { $ this -> _languageMap [ $ sourceSurveyId ] [ $ language ] = $ language ; } else { $ lsDb = $ this -> getSourceDatabase ( ) ; $ sql = 'SELECT language
                    FROM ' . $ this -> _getSurveysTableName ( ) . '
                    WHERE sid = ?' ; $ this -> _languageMap [ $ sourceSurveyId ] [ $ language ] = $ lsDb -> fetchOne ( $ sql , $ sourceSurveyId ) ; } } return $ this -> _languageMap [ $ sourceSurveyId ] [ $ language ] ; }
Returns the langauge to use for the survey when this language is specified.

Uses the requested language if it exists for the survey, the default language for the survey otherwise

@param int $sourceSurveyId Survey ID
@param string $language       (ISO) Language
@return string (ISO) Language
Returns the langauge to use for the survey when this language is specified .