From d78edc6765c02da4f5f9d3f62f8186f1d538fe7d 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 1f3434028f4..419368795fe 100644 --- a/Koha/ItemType.pm +++ b/Koha/ItemType.pm @@ -90,7 +90,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.25.1