Bug 34801

Summary: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)
Product: Koha Reporter: Matt Blenkinsop <matt.blenkinsop>
Component: I18N/L10NAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: david, f.demians, fridolin.somers, victor
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.05
Circulation function:
Bug Depends on: 34038    
Bug Blocks:    
Attachments: Bug 34801: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)
Bug 34801: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)
Bug 34801: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)

Description Matt Blenkinsop 2023-09-15 10:27:13 UTC

    
Comment 1 Matt Blenkinsop 2023-09-15 10:30:42 UTC
Created attachment 155662 [details] [review]
Bug 34801: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)

__() should be used in .js files, not .tt files

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 for JavaScript strings, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the strings are now in the .po file for translation. You
  should find the lines in the commit
Comment 2 David Nind 2023-10-01 19:39:13 UTC
Created attachment 156448 [details] [review]
Bug 34801: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)

__() should be used in .js files, not .tt files

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 for JavaScript strings, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the strings are now in the .po file for translation. You
  should find the lines in the commit

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2023-10-01 19:49:55 UTC
Testing notes (using KTD):

1. po/fr-FR-staff-prog.po - 'Account has been deleted' was added to the .po file (no occurrence before patch applied).

2. po/fr-FR-opac-bootstrap.po - 'No title' was already in the .po file before applying the patch - an additional line was added after the patch was applied (#: koha-tmpl/opac-tmpl/bootstrap/en/includes/js-biblio-format.inc:1)
Comment 4 Victor Grousset/tuxayo 2023-10-01 21:39:00 UTC
Created attachment 156452 [details] [review]
Bug 34801: Fix incorrect use of __() in .tt and .inc files (bug 34038 follow-up)

__() should be used in .js files, not .tt files

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 for JavaScript strings, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the strings are now in the .po file for translation. You
  should find the lines in the commit

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 5 Victor Grousset/tuxayo 2023-10-01 21:41:17 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 6 Tomás Cohen Arazi (tcohen) 2023-10-03 13:19:36 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-10-05 19:33:49 UTC
Pushed to 23.05.x for 23.05.05

Note that in 23.05.x js-biblio-format.inc does not exist