Skip to content

Commit

Permalink
use getIso1FromLocale, us weblate locales for ui
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Nov 18, 2024
1 parent 5800e0f commit de7dc80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions GoogleScholarPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use PKP\citation\CitationDAO;
use PKP\core\PKPApplication;
use PKP\db\DAORegistry;
use PKP\i18n\LocaleConversion;
use PKP\plugins\GenericPlugin;
use PKP\plugins\Hook;

Expand Down Expand Up @@ -180,7 +181,7 @@ public function submissionView($hookName, $args)
if ($subjects = $publication->getData('subjects')) {
foreach ($subjects as $locale => $localeSubjects) {
foreach ($localeSubjects as $i => $subject) {
$templateMgr->addHeader('googleScholarSubject' . $i++, '<meta name="citation_keywords" xml:lang="' . htmlspecialchars(substr($locale, 0, 2)) . '" content="' . htmlspecialchars($subject) . '"/>');
$templateMgr->addHeader('googleScholarSubject' . $i++, '<meta name="citation_keywords" xml:lang="' . htmlspecialchars(LocaleConversion::getIso1FromLocale($locale)) . '" content="' . htmlspecialchars($subject) . '"/>');
}
}
}
Expand All @@ -189,7 +190,7 @@ public function submissionView($hookName, $args)
if ($keywords = $publication->getData('keywords')) {
foreach ($keywords as $locale => $localeKeywords) {
foreach ($localeKeywords as $i => $keyword) {
$templateMgr->addHeader('googleScholarKeyword' . $i++, '<meta name="citation_keywords" xml:lang="' . htmlspecialchars(substr($locale, 0, 2)) . '" content="' . htmlspecialchars($keyword) . '"/>');
$templateMgr->addHeader('googleScholarKeyword' . $i++, '<meta name="citation_keywords" xml:lang="' . htmlspecialchars(LocaleConversion::getIso1FromLocale($locale)) . '" content="' . htmlspecialchars($keyword) . '"/>');
}
}
}
Expand Down

0 comments on commit de7dc80

Please sign in to comment.