Skip to content

Commit

Permalink
pkp/pkp-lib#9910 Use UI Language in Web Feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Jan 13, 2025
1 parent 1361507 commit b495687
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion WebFeedGatewayPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Exception;
use PKP\category\Category;
use PKP\core\Registry;
use PKP\facades\Locale;
use PKP\plugins\GatewayPlugin;
use PKP\userGroup\UserGroup;

Expand Down Expand Up @@ -127,7 +128,8 @@ public function fetch($args, $request): bool
'latestDate' => $latestDate,
'feedUrl' => $request->getRequestUrl(),
'userGroups' => $userGroups,
'includeIdentifiers' => $includeIdentifiers
'includeIdentifiers' => $includeIdentifiers,
'language' => str_replace(['_', '@'], '-', Locale::getLocale()),
]
)
->setHeaders(['content-type: ' . static::FEED_MIME_TYPE[$feedType] . '; charset=utf-8'])
Expand Down
4 changes: 1 addition & 3 deletions templates/rss.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
<dc:publisher>{$publisherInstitution|strip|escape:"html"}</dc:publisher>
{/if}

{if $context->getPrimaryLocale()}
<dc:language>{$context->getPrimaryLocale()|replace:'_':'-'|strip|escape:"html"}</dc:language>
{/if}
<dc:language>{$language|escape}</dc:language>

<prism:publicationName>{$context->getLocalizedName()|strip|escape:"html"}</prism:publicationName>

Expand Down
4 changes: 1 addition & 3 deletions templates/rss2.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
<description>{$description|strip|escape:"html"}</description>

{* optional elements *}
{if $context->getPrimaryLocale()}
<language>{$context->getPrimaryLocale()|replace:'_':'-'|strip|escape:"html"}</language>
{/if}
<language>{$language|escape}</language>

{if $context->getLocalizedData('licenseTerms')}
<copyright>{$context->getLocalizedData('licenseTerms')|strip|escape:"html"}</copyright>
Expand Down

0 comments on commit b495687

Please sign in to comment.