Skip to content

Commit

Permalink
Merge pull request #687 from ajnyga/f9976
Browse files Browse the repository at this point in the history
pkp/pkp-lib#9976 Display Galley language in Galleys Grid
  • Loading branch information
bozana authored May 24, 2024
2 parents a11fd74 + 892352d commit cfbd1fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use PKP\controllers\grid\DataObjectGridCellProvider;
use PKP\controllers\grid\GridHandler;
use PKP\controllers\grid\GridRow;
use PKP\facades\Locale;
use PKP\galley\Galley;

class PreprintGalleyGridCellProvider extends DataObjectGridCellProvider
Expand Down Expand Up @@ -65,6 +66,10 @@ public function getTemplateVarsFromRowColumn($row, $column)
return [
'label' => !$element->getData('urlRemote') && $element->getData('submissionFileId') ? '' : $element->getLabel()
];
case 'language':
return [
'label' => Locale::getSubmissionLocaleDisplayNames([$element->getLocale()], $this->getLocale())[$element->getLocale()]
];
default: assert(false);
}
return parent::getTemplateVarsFromRowColumn($row, $column);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ public function initialize($request, $args = null)
$cellProvider
));

$this->addColumn(new GridColumn(
'language',
'common.language',
null,
null,
$cellProvider
));

if ($this->canEdit()) {
$this->addAction(new LinkAction(
Expand Down

0 comments on commit cfbd1fa

Please sign in to comment.