ramon
July 21, 2021, 8:53pm
1
Hello all, @asmecher , @NateWr , @rcgillis
Which is the variable to display article ID in lib/pkp/locale/xx_YY/common.po: msgstr: available in ‘notification.type.reviewerComment’ ? There’s the title, but article ID is also essential as it is faster to find in our editorial process.
I’ve tried {$submissionId}, {$articleId} and {$id} but none have worked so far.
Hi @ramon ,
For locale keys like notification.type.reviewerComment
it’s not possible to add additional variables by updating the locale files. The locale files receive the variables when they are invoked in the code, (in PKPNotificationManager
in this case).
return $notificationSettings['contents'];
case NOTIFICATION_TYPE_PLUGIN_ENABLED:
return $this->_getTranslatedKeyWithParameters('common.pluginEnabled', $notification->getId());
case NOTIFICATION_TYPE_PLUGIN_DISABLED:
return $this->_getTranslatedKeyWithParameters('common.pluginDisabled', $notification->getId());
case NOTIFICATION_TYPE_REVIEWER_COMMENT:
assert($notification->getAssocType() == ASSOC_TYPE_REVIEW_ASSIGNMENT && is_numeric($notification->getAssocId()));
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO'); /* @var $reviewAssignmentDao ReviewAssignmentDAO */
$reviewAssignment = $reviewAssignmentDao->getById($notification->getAssocId());
$submission = $submissionDao->getById($reviewAssignment->getSubmissionId()); /* @var $submission Submission */
return __('notification.type.reviewerComment', array('title' => $submission->getLocalizedTitle()));
case NOTIFICATION_TYPE_EDITOR_ASSIGN:
assert($notification->getAssocType() == ASSOC_TYPE_SUBMISSION && is_numeric($notification->getAssocId()));
$submission = $submissionDao->getById($notification->getAssocId());
return __('notification.type.editorAssign', array('title' => $submission->getLocalizedTitle()));
case NOTIFICATION_TYPE_COPYEDIT_ASSIGNMENT:
assert($notification->getAssocType() == ASSOC_TYPE_SUBMISSION && is_numeric($notification->getAssocId()));
$submission = $submissionDao->getById($notification->getAssocId());
return __('notification.type.copyeditorRequest', array('title' => $submission->getLocalizedTitle()));
case NOTIFICATION_TYPE_LAYOUT_ASSIGNMENT:
assert($notification->getAssocType() == ASSOC_TYPE_SUBMISSION && is_numeric($notification->getAssocId()));
Regards,
Erik
PKP Team