From 8ed98372b986f182e54f20e363aa83f38e40da71 Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Tue, 29 Oct 2024 16:52:56 +0100 Subject: [PATCH 1/3] rename locale --- locale/{fr_FR => fr}/locale.po | 0 locale/{nb => nb_NO}/locale.po | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename locale/{fr_FR => fr}/locale.po (100%) rename locale/{nb => nb_NO}/locale.po (100%) diff --git a/locale/fr_FR/locale.po b/locale/fr/locale.po similarity index 100% rename from locale/fr_FR/locale.po rename to locale/fr/locale.po diff --git a/locale/nb/locale.po b/locale/nb_NO/locale.po similarity index 100% rename from locale/nb/locale.po rename to locale/nb_NO/locale.po From ceeb0b2e35249441c2172e869395bdb9e228c650 Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Thu, 5 Dec 2024 13:53:47 +0100 Subject: [PATCH 2/3] adapt language distribution --- filter/PreprintCrossrefXmlFilter.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/filter/PreprintCrossrefXmlFilter.php b/filter/PreprintCrossrefXmlFilter.php index 7c27385a88..bf33c3ba0d 100644 --- a/filter/PreprintCrossrefXmlFilter.php +++ b/filter/PreprintCrossrefXmlFilter.php @@ -18,7 +18,6 @@ use APP\plugins\generic\crossref\CrossrefExportDeployment; use APP\publication\Publication; use DOMDocument; -use PKP\i18n\LocaleConversion; use PKP\submission\PKPSubmission; class PreprintCrossrefXmlFilter extends \PKP\plugins\importexport\native\filter\NativeExportFilter @@ -155,7 +154,7 @@ public function createPostedContentNode($doc, $publication, $submission) $postedContentNode = $doc->createElementNS($deployment->getNamespace(), 'posted_content'); $postedContentNode->setAttribute('type', 'preprint'); - $postedContentNode->setAttribute('language', LocaleConversion::getIso1FromLocale($locale)); + $postedContentNode->setAttribute('language', \Locale::getPrimaryLanguage($locale)); // contributors $authors = $publication->getData('authors'); @@ -177,7 +176,7 @@ public function createPostedContentNode($doc, $publication, $submission) // Check if both givenName and familyName is set for the submission language. if (!empty($familyNames[$locale]) && !empty($givenNames[$locale])) { - $personNameNode->setAttribute('language', LocaleConversion::getIso1FromLocale($locale)); + $personNameNode->setAttribute('language', \Locale::getPrimaryLanguage($locale)); $personNameNode->appendChild($doc->createElementNS($deployment->getNamespace(), 'given_name', htmlspecialchars(ucfirst($givenNames[$locale]), ENT_COMPAT, 'UTF-8'))); $personNameNode->appendChild($doc->createElementNS($deployment->getNamespace(), 'surname', htmlspecialchars(ucfirst($familyNames[$locale]), ENT_COMPAT, 'UTF-8'))); @@ -195,7 +194,7 @@ public function createPostedContentNode($doc, $publication, $submission) } $nameNode = $doc->createElementNS($deployment->getNamespace(), 'name'); - $nameNode->setAttribute('language', LocaleConversion::getIso1FromLocale($otherLocal)); + $nameNode->setAttribute('language', \Locale::getPrimaryLanguage($otherLocal)); $nameNode->appendChild($doc->createElementNS($deployment->getNamespace(), 'surname', htmlspecialchars(ucfirst($familyName), ENT_COMPAT, 'UTF-8'))); if (isset($givenNames[$otherLocal]) && !empty($givenNames[$otherLocal])) { @@ -236,7 +235,7 @@ public function createPostedContentNode($doc, $publication, $submission) $abstracts = $publication->getData('abstract') ?: []; foreach($abstracts as $lang => $abstract) { $abstractNode = $doc->createElementNS($deployment->getJATSNamespace(), 'jats:abstract'); - $abstractNode->setAttributeNS($deployment->getXMLNamespace(), 'xml:lang', LocaleConversion::getIso1FromLocale($lang)); + $abstractNode->setAttributeNS($deployment->getXMLNamespace(), 'xml:lang', str_replace(['_', '@'], '-', $lang)); $abstractNode->appendChild($doc->createElementNS($deployment->getJATSNamespace(), 'jats:p', htmlspecialchars(html_entity_decode(strip_tags($abstract), ENT_COMPAT, 'UTF-8'), ENT_COMPAT, 'utf-8'))); $postedContentNode->appendChild($abstractNode); } From 3f88dfa93eb8843c545ae3e9e6b8dec5d951a5f3 Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Wed, 11 Dec 2024 12:27:52 +0100 Subject: [PATCH 3/3] rename pt_PT to pt --- locale/{pt_PT => pt}/locale.po | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename locale/{pt_PT => pt}/locale.po (100%) diff --git a/locale/pt_PT/locale.po b/locale/pt/locale.po similarity index 100% rename from locale/pt_PT/locale.po rename to locale/pt/locale.po