Bug 34334 - 'Item(s)' in MARC detail view untranslatable
Summary: 'Item(s)' in MARC detail view untranslatable
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 33185
Blocks:
  Show dependency treegraph
 
Reported: 2023-07-20 20:52 UTC by Caroline Cyr La Rose
Modified: 2023-09-13 21:03 UTC (History)
3 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.03,22.11.09


Attachments
Bug 34334: Item(s) in MARCdetail untranslatable (1.90 KB, patch)
2023-07-21 10:36 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34334: Item(s) in MARCdetail untranslatable (1.97 KB, patch)
2023-07-21 13:59 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 34334: Item(s) in MARCdetail untranslatable (2.02 KB, patch)
2023-07-21 14:06 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-20 20:52:18 UTC
I'm trying to find the string Item(s) for the items tab in the MARC view in the staff interface and it doesn't look like it's in the po files anymore.

To get there:
1. View any record in the staff interface
2. Click "MARC" on the left
--> Item(s) tab
3. Install new language
   3.1. Run the following commands in the terminal (replace fr-CA by any language code)

    cd misc/translator

    ./translate install fr-CA

   3.2. In the staff interface, go to Administration > System preferences
   3.3. Search for language
   3.4. Check the box for the new language
   3.5. Click Save all I18N//L10N preferences

4. Switch the staff interface to the new language
5. Refresh the MARC view page
--> Item(s) tab still in English
6. In the terminal, search the .po files for the "Item(s)" string
--> String not in the files
Comment 1 Caroline Cyr La Rose 2023-07-20 21:03:02 UTC
I tried adding a span tag around the word in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (line 146), but it's still not picking it up...
Comment 2 Owen Leonard 2023-07-21 10:36:52 UTC
Created attachment 153775 [details] [review]
Bug 34334: Item(s) in MARCdetail untranslatable

This patch adds a <span> around the text "Item(s)" in the template for
the MARC detail page in the staff interface. Without the span the
translation tool can't detect the string.

To test, apply the patch and update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the string is now in the .po file for translation. You
  should find these lines:

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt:146
c-format
msgid "Item(s)"
msgstr "Exemplaire(s)"

I found that the translation was already populated. Install the updated
po file:

 > perl translate install fr-FR

Test the MARC detail page in your translated language to confirm that
the string is correct.
Comment 3 Owen Leonard 2023-07-21 10:37:54 UTC
(In reply to Caroline Cyr La Rose from comment #1)
> I tried adding a span tag around the word in
> koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (line 146),
> but it's still not picking it up...

It worked for me! Give it a try and let me know if you're not getting the same result.
Comment 4 Caroline Cyr La Rose 2023-07-21 13:59:02 UTC
Created attachment 153794 [details] [review]
Bug 34334: Item(s) in MARCdetail untranslatable

This patch adds a <span> around the text "Item(s)" in the template for
the MARC detail page in the staff interface. Without the span the
translation tool can't detect the string.

To test, apply the patch and update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the string is now in the .po file for translation. You
  should find these lines:

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt:146
c-format
msgid "Item(s)"
msgstr "Exemplaire(s)"

I found that the translation was already populated. Install the updated
po file:

 > perl translate install fr-FR

Test the MARC detail page in your translated language to confirm that
the string is correct.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 5 Katrin Fischer 2023-07-21 14:06:24 UTC
Created attachment 153795 [details] [review]
Bug 34334: Item(s) in MARCdetail untranslatable

This patch adds a <span> around the text "Item(s)" in the template for
the MARC detail page in the staff interface. Without the span the
translation tool can't detect the string.

To test, apply the patch and update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the string is now in the .po file for translation. You
  should find these lines:

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt:146
c-format
msgid "Item(s)"
msgstr "Exemplaire(s)"

I found that the translation was already populated. Install the updated
po file:

 > perl translate install fr-FR

Test the MARC detail page in your translated language to confirm that
the string is correct.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 6 Caroline Cyr La Rose 2023-07-21 14:12:04 UTC
Thank you Owen! I'm stumped as to why it didn't work for me yesterday. My working hypothesis right now is that I was too tired and probably mangled the commands to translate. :)
Comment 7 Tomás Cohen Arazi 2023-07-21 20:15:38 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 8 Fridolin Somers 2023-08-04 02:05:08 UTC
Pushed to 23.05.x for 23.05.03
Comment 9 Pedro Amorim 2023-08-18 13:51:15 UTC
Nice work everyone!

Pushed to 22.11.x for next release
Comment 10 Lucas Gass 2023-09-13 21:03:24 UTC
Missing 22.05.x dependencies. No backport.