Skip to content

Commit

Permalink
fix author locale
Browse files Browse the repository at this point in the history
  • Loading branch information
ronste committed Feb 13, 2024
1 parent 542a335 commit 8c7d134
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DNBExportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
use DNBCatalogInfoProvider;


define('DEBUG', true);
define('DEBUG', false);

define('DNB_STATUS_DEPOSITED', 'deposited');
define('DNB_ADDITIONAL_PACKAGE_OPTIONS','--format=gnu');//use --format=gnu with tar to avoid PAX-Headers
Expand Down
7 changes: 3 additions & 4 deletions filter/DNBXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use APP\core\Application;
use APP\core\Services;
use APP\facades\Repo;
use PKP\facades\Locale;
use PKP\i18n\LocaleConversion;
use PKP\db\DAORegistry;
use PKP\filter\PersistableFilter;
Expand Down Expand Up @@ -212,7 +211,7 @@ function &process(&$pubObject) {

// Marc 100 first author
$datafield100 = $this->createDatafieldNode($doc, $recordNode, '100', '1', ' ');
$locale = $firstAuthor->getFamilyName($galleyLocale)?$galleyLocale:Locale::getLocale();
$locale = $firstAuthor->getFamilyName($galleyLocale)?$galleyLocale:$submission->getLocale();
$this->createSubfieldNode($doc, $datafield100, 'a', trim($firstAuthor->getFamilyName($locale)).', '.trim($firstAuthor->getGivenName($locale)));
if (!empty($firstAuthor->getData('orcidAccessToken'))) {
$this->createSubfieldNode($doc, $datafield100, '0', '(orcid)'.basename(trim($firstAuthor->getOrcid())));
Expand Down Expand Up @@ -338,7 +337,7 @@ function &process(&$pubObject) {
// other authors
foreach ((array) $authors as $author) {
$datafield700 = $this->createDatafieldNode($doc, $recordNode, '700', '1', ' ');
$locale = $author->getFamilyName($galleyLocale)?$galleyLocale:Locale::getLocale();
$locale = $author->getFamilyName($galleyLocale)?$galleyLocale:$submission->getLocale();
$this->createSubfieldNode($doc, $datafield700, 'a', trim($author->getFamilyName($locale)).', '.trim($author->getGivenName($locale)));
if (!empty($author->getData('orcidAccessToken'))) {
$this->createSubfieldNode($doc, $datafield700, '0', '(orcid)'.basename(trim($author->getOrcid())));
Expand All @@ -349,7 +348,7 @@ function &process(&$pubObject) {
// translators
foreach ((array) $translators as $translator) {
$datafield700 = $this->createDatafieldNode($doc, $recordNode, '700', '1', ' ');
$locale = $author->getFamilyName($galleyLocale)?$galleyLocale:Locale::getLocale();
$locale = $author->getFamilyName($galleyLocale)?$galleyLocale:$submission->getLocale();
$this->createSubfieldNode($doc, $datafield700, 'a', trim($translator->getFamilyName($locale)).', '.trim($translator->getGivenName($locale)));
if (!empty($translator->getData('orcidAccessToken'))) {
$this->createSubfieldNode($doc, $datafield700, '0', '(orcid)'.basename(trim($translator->getOrcid())));
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
<application>dnb</application>
<type>plugins.importexport</type>
<release>1.6.0</release>
<date>2023-10-23</date>
<date>2024-02-13</date>
</version>

0 comments on commit 8c7d134

Please sign in to comment.