From f049e40c44097df367bd13cfa28ffe934b967dcf Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 27 Jul 2023 14:49:50 +0000 Subject: [PATCH] Bug 34433: 'Custom cover image' in lightbox is untranslatable In the staff interface, when viewing a custom cover image in the lightbox, at the bottom, it says 'Custom cover image'. This string is not translatable. The string is missing the _() i18n function. This patch also corrects the "Coce image from Amazon.com" which was missing the correct i18n function too. If necessary, import the MARC records attached to this bug to use in testing. 1. Enable CustomCoverImages 1.1. Go to Administration > System preferences 1.2. Search for CustomCoverImages 1.3. Select "Show" in CustomCoverImages 1.4. Set CustomCoverImagesURL to {956$u} 1.5. Click "Save all Enhanced content preferences" 2. Install a new language 2.1. gulp po:update --lang fr-CA 2.2. Search for "Custom cover image" and "Coce image from Amazon.com" in fr-CA-staff-prog.po file, make sure it is translated 2.3. Install translations ./misc/translator/translate install fr-CA 2.4. In the staff interface, go to Administration > System preferences 2.5. Search for language 2.6. Check the box next to the newly installed language 2.7. Click "Save all I18N/L10N preferences" 3. View the image in the lightbox in the staff interface 3.1. If using the attached records, search the catalog in the staff interface for "As you like it"; If not using the file, add an image URL in 956$u, or finagle something with CustomCoverImagesURL 3.2. Click on the title to view the detailed record 3.3. Click on the image to view it in the lightbox Test the lightbox in the default English translation and in your newly-translated language. In both cases the caption in the lightbox footer should be correct. Signed-off-by: Caroline Cyr La Rose Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 2d7c7a1535..05e83a534e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1505,7 +1505,7 @@ // Remove the container div.remove(); } else { - lightbox_descriptions.push("Custom cover image"); + lightbox_descriptions.push( _("Custom cover image") ); } } else if ( div.attr("id") == "syndetics-bookcoverimg" ){ lightbox_descriptions.push(_("Syndetics cover image (see the original image)").format($(img).data('link'))); @@ -1514,7 +1514,7 @@ // Identify which service's image is being loaded by Coce var coce_description; if( $(img).attr("src").indexOf('amazon.com') >= 0 ){ - coce_description = ("Coce image from Amazon.com"); + coce_description = _("Coce image from Amazon.com"); } else if( $(img).attr("src").indexOf('google.com') >= 0 ){ coce_description = _("Coce image from Google Books"); } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){ -- 2.39.5