From 64056bcacc976c880e47af6029c25a6e6c3d105d Mon Sep 17 00:00:00 2001 From: jyhein <124268211+jyhein@users.noreply.github.com> Date: Wed, 4 Oct 2023 14:23:35 +0300 Subject: [PATCH 1/3] pkp/pkp-lib#5000 Remove separate Dublin Core Language metadata field and only use Submission Locale to define the language --- cypress/tests/integration/SubmissionWizard.cy.js | 6 ------ plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php | 7 +------ .../dc/tests/OAIMetadataFormat_DCTest.php | 1 - 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/cypress/tests/integration/SubmissionWizard.cy.js b/cypress/tests/integration/SubmissionWizard.cy.js index 091bbb92380..92141a4ecd1 100644 --- a/cypress/tests/integration/SubmissionWizard.cy.js +++ b/cypress/tests/integration/SubmissionWizard.cy.js @@ -273,7 +273,6 @@ describe('Submission Wizard', function() { metadata: { autosuggest: { disciplines: 'Faucibus', - languages: 'Ornare', subjects: 'Suspendisse', supportingAgencies: 'Porttitor', }, @@ -301,7 +300,6 @@ describe('Submission Wizard', function() { 'Coverage', 'Data Availability Statement', 'Disciplines', - 'Languages', 'Rights', 'Source', 'Subjects', @@ -326,7 +324,6 @@ describe('Submission Wizard', function() { dataAvailability: 'require', disciplines: 'require', keywords: 'require', - languages: 'require', rights: 'require', source: 'require', subjects: 'require', @@ -463,7 +460,6 @@ describe('Submission Wizard', function() { dataAvailability: 'request', disciplines: 'request', keywords: 'require', - languages: 'request', rights: 'request', source: 'request', subjects: 'require', @@ -531,7 +527,6 @@ describe('Submission Wizard', function() { const metadata = { subjects: "Subjects", disciplines: "Disciplines", - languages: "Languages", supportingAgencies: "Supporting Agencies", coverage: "Coverage", rights: "Rights", @@ -629,7 +624,6 @@ describe('Submission Wizard', function() { dataAvailability: '0', disciplines: '0', keywords: 'request', - languages: '0', rights: '0', source: '0', subjects: '0', diff --git a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php index 70adfd7af20..20cad13b6f6 100644 --- a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php +++ b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php @@ -193,12 +193,7 @@ public function &extractMetadataFromDataObject(&$article) $dc11Description->addStatement('dc:language', LocaleConversion::getIso3FromLocale($locale)); } } - } - $articleLanguages = $article->getLanguage(); - if (empty($locales) && isset($articleLanguages[$article->getLocale()])) { - foreach ($articleLanguages[$article->getLocale()] as $language) { - $dc11Description->addStatement('dc:language', $language); - } + $dc11Description->addStatement('dc:language', $article->geData('locale')); } // Relation diff --git a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php index 790890bc13e..1c647bba5e1 100755 --- a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php +++ b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php @@ -111,7 +111,6 @@ public function testToXml() $publication->setData('abstract', 'article-abstract', 'en'); $publication->setData('sponsor', 'article-sponsor', 'en'); $publication->setData('doiObject', $publicationDoiObject); - $publication->setData('languages', ['en' => ['en']]); $publication->setData('copyrightHolder', 'article-copyright'); $publication->setData('copyrightYear', 'year'); $publication->setData('authors', collect([$author])); From 77c07814c83baf135e17cc9708c008ef623a5040 Mon Sep 17 00:00:00 2001 From: jyhein <124268211+jyhein@users.noreply.github.com> Date: Thu, 2 Nov 2023 10:08:43 +0200 Subject: [PATCH 2/3] pkp/pkp-lib#5000 Remove separate Dublin Core Language metadata field and only use Submission Locale to define the language --- .../dc11/filter/Dc11SchemaArticleAdapter.php | 18 ++++++------------ .../dc/tests/OAIMetadataFormat_DCTest.php | 1 + 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php index 20cad13b6f6..9dff5e5f7d5 100644 --- a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php +++ b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php @@ -30,7 +30,6 @@ use APP\submission\Submission; use PKP\db\DAORegistry; use PKP\facades\Locale; -use PKP\i18n\LocaleConversion; use PKP\metadata\MetadataDataObjectAdapter; use PKP\metadata\MetadataDescription; use PKP\plugins\Hook; @@ -184,17 +183,12 @@ public function &extractMetadataFromDataObject(&$article) } // Language - $locales = []; - if ($article instanceof Submission) { - foreach ($galleys as $galley) { - $locale = $galley->getLocale(); - if (!is_null($locale) && !in_array($locale, $locales)) { - $locales[] = $locale; - $dc11Description->addStatement('dc:language', LocaleConversion::getIso3FromLocale($locale)); - } - } - $dc11Description->addStatement('dc:language', $article->geData('locale')); - } + collect($galleys) + ->map(fn ($g) => $g->getData('locale')) + ->push($publication->getData('locale')) + ->filter() + ->unique() + ->each(fn ($l) => $dc11Description->addStatement('dc:language', $l)); // Relation // full text URLs diff --git a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php index 1c647bba5e1..e7d6ce044b4 100755 --- a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php +++ b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php @@ -152,6 +152,7 @@ public function testToXml() ->will($this->returnValue(98)); $galley->setId(98); $galley->setData('doiObject', $galleyDoiObject); + $galley->setData('locale', 'en'); $galleys = [$galley]; From c7ebbc8a1d0e56703055aa0fc029b84104e51b77 Mon Sep 17 00:00:00 2001 From: jyhein <124268211+jyhein@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:55:20 +0200 Subject: [PATCH 3/3] pkp/pkp-lib#5000 Submodule update ##jyhein/f5000## --- lib/pkp | 2 +- plugins/generic/citationStyleLanguage | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pkp b/lib/pkp index a3287088893..515da5c286c 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit a328708889384c54584bf6332ac65c740a599e95 +Subproject commit 515da5c286caade25c115ce80cc650f77874525e diff --git a/plugins/generic/citationStyleLanguage b/plugins/generic/citationStyleLanguage index ae8028c801e..b0cddf18825 160000 --- a/plugins/generic/citationStyleLanguage +++ b/plugins/generic/citationStyleLanguage @@ -1 +1 @@ -Subproject commit ae8028c801e9b94233132809f90e11ef6fa6aa35 +Subproject commit b0cddf188254dca5337960faa7c03716b98d6499