Skip to content

Commit

Permalink
pkp/pkp-lib#9976 Display Galley language in Galleys Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti-Jussi Nygård authored and Antti-Jussi Nygård committed May 24, 2024
1 parent 3af670c commit 892352d
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 892352d

Please sign in to comment.