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 <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-07-27 14:49:50 +00:00 committed by Tomas Cohen Arazi
parent 5749df1e3a
commit f049e40c44
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 2 additions and 2 deletions

View File

@ -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 (<a href='%s'>see the original image</a>)").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 ){