Skip to content

Commit

Permalink
Merge pull request #577 from jyhein/f5000
Browse files Browse the repository at this point in the history
Remove separate Dublin Core Language metadata field and only use Submission Locale to define the language
  • Loading branch information
bozana authored Nov 28, 2023
2 parents f84ab62 + 5bfc142 commit 3fce0fc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/pkp
Submodule pkp updated 79 files
+0 −11 api/v1/vocabs/PKPVocabController.php
+0 −13 classes/components/forms/context/PKPMetadataSettingsForm.php
+0 −12 classes/components/forms/publication/PKPMetadataForm.php
+10 −0 classes/components/forms/site/PKPSiteConfigForm.php
+0 −1 classes/context/Context.php
+0 −3 classes/core/PKPApplication.php
+0 −1 classes/install/Installer.php
+0 −12 classes/publication/DAO.php
+2 −0 classes/submission/SubmissionLanguage.php
+2 −0 classes/submission/SubmissionLanguageDAO.php
+2 −0 classes/submission/SubmissionLanguageEntryDAO.php
+5 −1 classes/user/Collector.php
+0 −3 controllers/modals/submission/ViewSubmissionMetadataHandler.php
+0 −17 locale/ar/manager.po
+0 −20 locale/az/manager.po
+0 −15 locale/be@cyrillic/manager.po
+0 −23 locale/bg/manager.po
+0 −15 locale/bs/manager.po
+0 −22 locale/ca/manager.po
+0 −15 locale/ckb/manager.po
+0 −17 locale/cs/manager.po
+0 −19 locale/da/manager.po
+0 −18 locale/de/manager.po
+0 −22 locale/el/manager.po
+11 −0 locale/en/admin.po
+0 −21 locale/en/manager.po
+0 −20 locale/es/manager.po
+0 −15 locale/eu/manager.po
+0 −15 locale/fa/manager.po
+0 −17 locale/fi/manager.po
+12 −0 locale/fr_CA/admin.po
+0 −23 locale/fr_CA/manager.po
+0 −23 locale/fr_FR/manager.po
+0 −15 locale/gd/manager.po
+0 −18 locale/gl/manager.po
+0 −15 locale/he/manager.po
+0 −15 locale/hi/manager.po
+0 −17 locale/hr/manager.po
+0 −21 locale/hu/manager.po
+0 −18 locale/hy/manager.po
+0 −23 locale/id/manager.po
+0 −20 locale/is/manager.po
+0 −23 locale/it/manager.po
+0 −17 locale/ja/manager.po
+0 −18 locale/ka/manager.po
+0 −19 locale/kk/manager.po
+0 −15 locale/ko/manager.po
+0 −15 locale/lt/manager.po
+0 −15 locale/lv/manager.po
+0 −22 locale/mk/manager.po
+0 −15 locale/mn/manager.po
+0 −19 locale/ms/manager.po
+0 −18 locale/nb/manager.po
+0 −23 locale/nl/manager.po
+0 −19 locale/pl/manager.po
+0 −20 locale/pt_BR/manager.po
+0 −20 locale/pt_PT/manager.po
+0 −23 locale/ro/manager.po
+0 −19 locale/ru/manager.po
+0 −15 locale/sk/manager.po
+0 −19 locale/sl/manager.po
+0 −15 locale/sr@cyrillic/manager.po
+0 −15 locale/sr@latin/manager.po
+0 −17 locale/sv/manager.po
+0 −19 locale/tr/manager.po
+0 −18 locale/uk/manager.po
+0 −15 locale/uz@cyrillic/manager.po
+0 −15 locale/uz@latin/manager.po
+0 −18 locale/vi/manager.po
+0 −15 locale/zh_CN/manager.po
+0 −15 locale/zh_Hant/manager.po
+0 −1 plugins/importexport/native/filter/NativeXmlPKPPublicationFilter.php
+0 −1 plugins/importexport/native/filter/PKPPublicationNativeXmlFilter.php
+0 −8 schemas/context.json
+0 −11 schemas/publication.json
+5 −0 schemas/site.json
+7 −7 templates/controllers/grid/users/reviewer/readReview.tpl
+0 −3 templates/submission/review-editors.tpl
+0 −2 tests/classes/publication/PublicationTest.php
2 changes: 1 addition & 1 deletion plugins/generic/citationStyleLanguage
22 changes: 7 additions & 15 deletions plugins/metadata/dc11/filter/Dc11SchemaPreprintAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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;
Expand Down Expand Up @@ -59,6 +58,7 @@ public function &injectMetadataIntoDataObject(&$metadataDescription, &$targetDat
* @param Submission $submission
*
* @return MetadataDescription
*
* @hook Dc11SchemaPreprintAdapter::extractMetadataFromDataObject [[$this, $submission, $server, &$dc11Description]]
*/
public function &extractMetadataFromDataObject(&$submission)
Expand Down Expand Up @@ -145,20 +145,12 @@ public function &extractMetadataFromDataObject(&$submission)
$dc11Description->addStatement('dc:identifier', $request->url($server->getPath(), 'preprint', 'view', [$submission->getBestId()]));

// Language
$locales = [];
foreach ($galleys as $galley) {
$galleyLocale = $galley->getLocale();
if (!is_null($galleyLocale) && !in_array($galleyLocale, $locales)) {
$locales[] = $galleyLocale;
$dc11Description->addStatement('dc:language', LocaleConversion::getIso3FromLocale($galleyLocale));
}
}
$submissionLanguages = $submission->getLanguage();
if (empty($locales) && isset($submissionLanguages[$submission->getLocale()])) {
foreach ($submissionLanguages[$submission->getLocale()] as $language) {
$dc11Description->addStatement('dc:language', $language);
}
}
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public function testToXml()
$publication->setData('abstract', 'preprint-abstract', 'en');
$publication->setData('sponsor', 'preprint-sponsor', 'en');
$publication->setData('doiObject', $publicationDoiObject);
$publication->setData('languages', ['en' => ['en']]);
$publication->setData('copyrightHolder', 'preprint-copyright');
$publication->setData('copyrightYear', 'year');
$publication->setData('datePublished', '2010-11-05');
Expand Down Expand Up @@ -144,6 +143,7 @@ public function testToXml()
->will($this->returnValue(98));
$galley->setId(98);
$galley->setData('doiObject', $galleyDoiObject);
$galley->setData('locale', 'en');

$galleys = [$galley];

Expand Down

0 comments on commit 3fce0fc

Please sign in to comment.