Bug 34433 - 'Custom cover image' in lightbox is untranslatable
Summary: 'Custom cover image' in lightbox is untranslatable
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-27 13:21 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:46 UTC (History)
2 users (show)

See Also:
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


Attachments
Sample records (3.30 KB, text/plain)
2023-07-27 13:21 UTC, Caroline Cyr La Rose
Details
Bug 34433: 'Custom cover image' in lightbox is untranslatable (3.56 KB, patch)
2023-07-27 14:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34433: 'Custom cover image' in lightbox is untranslatable (3.63 KB, patch)
2023-07-27 15:12 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 34433: 'Custom cover image' in lightbox is untranslatable (3.69 KB, patch)
2023-07-31 21:08 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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