Skip to content

Commit

Permalink
pkp/pkp-lib#9910 Use UI Language in Announcement Feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Jul 17, 2024
1 parent eb30649 commit d74620c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use APP\template\TemplateManager;
use PKP\core\Core;
use PKP\db\DAORegistry;
use PKP\facades\Locale;
use PKP\plugins\GatewayPlugin;
use PKP\site\VersionDAO;

Expand Down Expand Up @@ -161,6 +162,7 @@ public function fetch($args, $request)
'dateUpdated' => $dateUpdated,
'announcements' => $announcements,
'journal' => $journal,
'language' => str_replace('_', '-', str_replace(['@cyrillic', '@latin', '_Latn', '_Cyrl'], '', Locale::getLocale())),
]);

$templateMgr->setHeaders(['content-type: ' . $mimeTypeMap[$type] . '; charset=utf-8']);
Expand Down
2 changes: 1 addition & 1 deletion plugins/generic/announcementFeed/templates/rss.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

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

<items>
Expand Down
2 changes: 1 addition & 1 deletion plugins/generic/announcementFeed/templates/rss2.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

{* optional elements *}
{if $journal->getPrimaryLocale()}
<language>{$journal->getPrimaryLocale()|replace:'_':'-'|strip|escape:"html"}</language>
<language>{$language|escape}</language>
{/if}
{capture assign="dateUpdated"}{$dateUpdated|strtotime}{/capture}
<pubDate>{$smarty.const.DATE_RSS|date:$dateUpdated}</pubDate>
Expand Down

0 comments on commit d74620c

Please sign in to comment.