From 6765da462b418c15504ef1ee8b9bc06c5b7fd412 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 29 Sep 2020 10:14:04 +0100 Subject: [PATCH] Bug 24975: Add translation_key method example --- Koha/ItemType.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Koha/ItemType.pm b/Koha/ItemType.pm index e0a5fd1535..9e66529671 100644 --- a/Koha/ItemType.pm +++ b/Koha/ItemType.pm @@ -46,7 +46,20 @@ Returns a localized string for the Koha::ItemType description field. sub translated_description { my ( $self ) = @_; - return dt_t('itemtype', $self->itemtype); + return dt_t('itemtype', $self->translation_key); +} + +=head3 translation_key + + db_t('itemtype', $itemtype->translation_key); + +Returns the translation key for this itemtype object. + +=cut + +sub translation_key { + my ( $self ) = @_; + return $self->itemtype; } =head3 image_location -- 2.20.1