Bug 25321

Summary: Move translatable strings out of strings.inc into the corresponding JavaScript
Product: Koha Reporter: Owen Leonard <oleonard>
Component: I18N/L10NAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, f.demians, jonathan.druart, lucas, testopia
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.05
Bug Depends on: 21156    
Bug Blocks: 28802    
Attachments: Bug 25321: (Part 1) Move translatable strings out of strings.inc into checkouts.js
Bug 25321: (Part 1) Move translatable strings out of strings.inc into checkouts.js
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript
Bug 25321: Remove PLACE_HOLD from results.js
Bug 25321: Remove 2 remaining occurrences of strings.inc

Description Owen Leonard 2020-04-29 19:00:56 UTC
Strings which were put in strings.inc for translation purposes can now be wrapped in the new translation function and put in the various JavaScript files where they're used.
Comment 1 Owen Leonard 2020-06-18 16:26:50 UTC
Files to be updated:

checkouts.js
holds.js
results.js
Comment 2 Owen Leonard 2020-06-18 16:50:33 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2020-06-18 16:55:00 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2020-08-24 17:58:58 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2020-09-10 18:38:04 UTC
Created attachment 109858 [details] [review]
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript

This patch moves string definitions out of strings.inc and into the
corresponding JavaScript files.

To test, apply the patch and test various pages in the staff interface:

A few suggestions:

- Perform a catalog search and view the detail page for a bibliographic record.
  - Confirm that the search results browser in the left-hand sidebar
    work correctly and that the title attributes of the controls are
    correct.
- Locate a patron with multiple checkouts. View the checkout page and
  test the various controls in the table of checkouts: Renew, check in,
  return claims, etc.
- View the list of holds on a patron's account. Test suspending and
  resuming holds.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

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

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/checkouts.js for
  translation, e.g.:

  msgid "Checked in"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for
  testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.
Comment 6 Lucas Gass 2020-09-11 23:02:58 UTC
Created attachment 109971 [details] [review]
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript

This patch moves string definitions out of strings.inc and into the
corresponding JavaScript files.

To test, apply the patch and test various pages in the staff interface:

A few suggestions:

- Perform a catalog search and view the detail page for a bibliographic record.
  - Confirm that the search results browser in the left-hand sidebar
    work correctly and that the title attributes of the controls are
    correct.
- Locate a patron with multiple checkouts. View the checkout page and
  test the various controls in the table of checkouts: Renew, check in,
  return claims, etc.
- View the list of holds on a patron's account. Test suspending and
  resuming holds.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

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

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/checkouts.js for
  translation, e.g.:

  msgid "Checked in"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for
  testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Katrin Fischer 2020-09-12 17:44:00 UTC
Created attachment 109984 [details] [review]
Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript

This patch moves string definitions out of strings.inc and into the
corresponding JavaScript files.

To test, apply the patch and test various pages in the staff interface:

A few suggestions:

- Perform a catalog search and view the detail page for a bibliographic record.
  - Confirm that the search results browser in the left-hand sidebar
    work correctly and that the title attributes of the controls are
    correct.
- Locate a patron with multiple checkouts. View the checkout page and
  test the various controls in the table of checkouts: Renew, check in,
  return claims, etc.
- View the list of holds on a patron's account. Test suspending and
  resuming holds.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

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

- Open the corresponding .po file for JavaScript strings, e.g.
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/intranet-tmpl/prog/js/checkouts.js for
  translation, e.g.:

  msgid "Checked in"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for
  testing).
- Install the updated translation:

  > perl translate install fr-FR

- Switch to your newly translated language in the staff client
  and repeat the test plan above. The translated strings should
  appear.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Jonathan Druart 2020-09-29 09:12:39 UTC
Created attachment 110893 [details] [review]
Bug 25321: Remove PLACE_HOLD from results.js
Comment 9 Jonathan Druart 2020-09-29 12:22:50 UTC
Cannot edit a biblio:
Template process failed: file error - strings.inc: not found at /kohadevbox/koha/C4/Templates.pm line 122

There are 2 remaining occurrences of strings.inc

koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt:[% INCLUDE 'strings.inc' %]
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt:[% INCLUDE 'strings.inc' %]
Comment 10 Jonathan Druart 2020-09-29 12:27:38 UTC
Created attachment 110906 [details] [review]
Bug 25321: Remove 2 remaining occurrences of strings.inc

They were used for browser.js
Comment 11 Jonathan Druart 2020-09-29 12:31:08 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 12 Lucas Gass 2020-10-20 16:15:08 UTC
backported to 20.05.x for 20.05.05
Comment 13 Aleisha Amohia 2020-10-27 04:25:06 UTC
enhancement, not backported to 19.11.x