Skip to content

Commit

Permalink
pkp/pkp-lib#9374 Make author bio multilingual
Browse files Browse the repository at this point in the history
  • Loading branch information
ewhanson authored and asmecher committed Nov 22, 2023
1 parent e853146 commit f19c0b6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions JatsTemplatePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,12 @@ function toXml(&$record, $format = null) {
$config->set('Cache.SerializerPath', 'cache');
$purifier = new HTMLPurifier($config);
}
$response .= (($bio = $author->getLocalizedBiography()) != '' ? "\t\t\t\t\t<bio>" . $purifier->purify($bio) . '</bio>\n' : '') .
"\t\t\t\t</contrib>\n";

foreach ($author->getData('biography') as $locale => $bio) {
$response .= "\t\t\t\t\t<bio xml:lang=\"" . substr($locale, 0, 2) . "\">" . $purifier->purify($bio) . "</bio>\n";
}

$response .= "\t\t\t\t</contrib>\n";
}
$response .= "\t\t\t</contrib-group>\n";
foreach ($affiliations as $affiliationToken => $affiliation) {
Expand Down

0 comments on commit f19c0b6

Please sign in to comment.