Bug 34433

Summary: 'Custom cover image' in lightbox is untranslatable
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: I18N/L10NAssignee: Owen Leonard <oleonard>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: f.demians, fridolin.somers
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04
Circulation function:
Attachments: Sample records
Bug 34433: 'Custom cover image' in lightbox is untranslatable
Bug 34433: 'Custom cover image' in lightbox is untranslatable
Bug 34433: 'Custom cover image' in lightbox is untranslatable

Description Caroline Cyr La Rose 2023-07-27 13:21:58 UTC
Created attachment 153974 [details]
Sample records

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.

To test:

Note: I attached a file of sample (MARC21) records that I use for various image sources, in which one record has a URL to an image in 956$u, you can import this file into Koha, if needed

      - Download the attached marc file (coverimages.mrc)
      - In the Koha staff interface, go to Cataloging > Stage records for import
      - Click the "Choose file" or "Browse" button and choose the downloaded file
      - Click "Upload file"
      - Click "Stage for import"
      - Click "View detail of the enqueued job"
      - Click "View batch"
      - Click "Import this batch into the catalog"


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 new language
   2.1. gulp po:update --lang fr-CA
   2.2. Search for "Custom cover image" in the 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

        --> In the image box, notice that it says "Custom cover image"

   3.4. Click the X to close the lightbox

5. Change the language of the staff interface

6. Reopen the lightbox

   --> The caption of the lightbox is still "Custom cover image" in the other language even if the string was translated in the po file
Comment 1 Owen Leonard 2023-07-27 14:59:43 UTC
Created attachment 153993 [details] [review]
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.
Comment 2 Caroline Cyr La Rose 2023-07-27 15:12:17 UTC
Created attachment 153994 [details] [review]
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>
Comment 3 Caroline Cyr La Rose 2023-07-27 15:13:06 UTC
Thanks Owen! You did it so fast that I still had my tab open! I only had to apply, install and refresh XD
Comment 4 Katrin Fischer 2023-07-31 21:08:50 UTC
Created attachment 154118 [details] [review]
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>
Comment 5 Tomás Cohen Arazi (tcohen) 2023-08-15 09:14:26 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-08-29 21:37:13 UTC
Pushed to 23.05.x for 23.05.04