Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#9707 use weblate locales for ui #4495

Merged
merged 10 commits into from
Dec 11, 2024
Prev Previous commit
Next Next commit
ORCID fix: provide no element if the locale is not in ISO 639-1, fix …
…localized publication title
bozana committed Dec 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d4f1460aeccd7d5db68f78a55fec281d057a4cde
7 changes: 5 additions & 2 deletions classes/orcid/OrcidReview.php
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ private function build(): array
$orcidReview['review-url'] = ['value' => $publicationUrl];
$orcidReview['subject-type'] = 'journal-article';
$orcidReview['subject-name'] = [
'title' => ['value' => $this->submission->getCurrentPublication()->getLocalizedData('title') ?? '']
'title' => ['value' => $this->submission->getCurrentPublication()->getLocalizedTitle($submissionLocale) ?? '']
];

if (!empty($currentPublication->getDoi())) {
@@ -125,7 +125,10 @@ private function build(): array
$allTitles = $currentPublication->getData('title');
foreach ($allTitles as $locale => $title) {
if ($locale !== $submissionLocale) {
$orcidReview['subject-name']['translated-title'] = ['value' => $title, 'language-code' => LocaleConversion::getIso1FromLocale($locale)];
$iso1Locale = LocaleConversion::getIso1FromLocale($locale);
if ($iso1Locale) {
$orcidReview['subject-name']['translated-title'] = ['value' => $title, 'language-code' => $iso1Locale];
}
}
}