/** * @see DOIExportDom::getPrimaryObjectLocale() * @param $suppFile SuppFile */ function getPrimaryObjectLocale(&$article, &$galley, &$suppFile) { $primaryObjectLocale = null; if (is_a($suppFile, 'SuppFile')) { // Try to map the supp-file language to a PKP locale. $suppFileLanguage = $suppFile->getLanguage(); if (strlen($suppFileLanguage) == 2) { $suppFileLanguage = AppLocale::get3LetterFrom2LetterIsoLanguage($suppFileLanguage); } if (strlen($suppFileLanguage) == 3) { $primaryObjectLocale = AppLocale::getLocaleFrom3LetterIso($suppFileLanguage); } } // If mapping didn't work or we do not have a supp file then // retrieve the locale from the other objects. if (!AppLocale::isLocaleValid($primaryObjectLocale)) { $primaryObjectLocale = parent::getPrimaryObjectLocale($article, $galley); } return $primaryObjectLocale; }