Bug 26291 - Move translatable strings out of z3950_search.inc into z3950_search.js
Summary: Move translatable strings out of z3950_search.inc into z3950_search.js
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 21156
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-24 18:24 UTC by Owen Leonard
Modified: 2020-11-20 20:21 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Manual merge request:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.05


Attachments
Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js (7.36 KB, patch)
2020-08-24 18:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js (7.41 KB, patch)
2020-09-27 02:19 UTC, David Nind
Details | Diff | Splinter Review
Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js (7.46 KB, patch)
2020-09-27 12:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26291: (follow-up) Correct stray MSG instances (1.77 KB, patch)
2020-09-29 11:34 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2020-08-24 18:24:44 UTC
Strings defined for translation in z3950_search.inc can now be wrapped in the new translation function and put in z3950_search.js.
Comment 1 Owen Leonard 2020-08-24 18:59:12 UTC
Created attachment 109032 [details] [review]
Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js

This patch moves translatable strings out of z3950_search.inc into
z3950_search.js, wrapped in the double-underscore function for
translation.

To test, apply the patch and go to Cataloging.

 - Click "New from Z39.50/SRU"
 - In the search form, uncheck all search targets and submit the form.
   You should get an error: "Please choose at least one external target"
 - Peform a search which will return multiple pages of results.
 - Test  that you can enter a number in the "Go to page" form to
   navigate to a specific page.
 - Enter a non-number in the field and submit. You should get an error,
   "The page entered is not a number."
 - Enter a number in the field which is greater than the number of pages
   of results. Submitting the form should trigger an error, "The page
   should be a number between 1 and 10."

 - Perform the same tests from the other Z39.50 search results
   interfaces:
   - Acquisitions -> Add to basket -> From an external source.
   - Authorities -> New authority -> New from Z39.50/SRU.

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/z3950_search.js for translation,
  e.g.:

  msgid "The page entered is not a number."
  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 2 David Nind 2020-09-27 02:19:21 UTC
Created attachment 110811 [details] [review]
Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js

This patch moves translatable strings out of z3950_search.inc into
z3950_search.js, wrapped in the double-underscore function for
translation.

To test, apply the patch and go to Cataloging.

 - Click "New from Z39.50/SRU"
 - In the search form, uncheck all search targets and submit the form.
   You should get an error: "Please choose at least one external target"
 - Peform a search which will return multiple pages of results.
 - Test  that you can enter a number in the "Go to page" form to
   navigate to a specific page.
 - Enter a non-number in the field and submit. You should get an error,
   "The page entered is not a number."
 - Enter a number in the field which is greater than the number of pages
   of results. Submitting the form should trigger an error, "The page
   should be a number between 1 and 10."

 - Perform the same tests from the other Z39.50 search results
   interfaces:
   - Acquisitions -> Add to basket -> From an external source.
   - Authorities -> New authority -> New from Z39.50/SRU.

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/z3950_search.js for translation,
  e.g.:

  msgid "The page entered is not a number."
  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: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2020-09-27 12:02:42 UTC
Created attachment 110828 [details] [review]
Bug 26291: Move translatable strings out of z3950_search.inc into z3950_search.js

This patch moves translatable strings out of z3950_search.inc into
z3950_search.js, wrapped in the double-underscore function for
translation.

To test, apply the patch and go to Cataloging.

 - Click "New from Z39.50/SRU"
 - In the search form, uncheck all search targets and submit the form.
   You should get an error: "Please choose at least one external target"
 - Peform a search which will return multiple pages of results.
 - Test  that you can enter a number in the "Go to page" form to
   navigate to a specific page.
 - Enter a non-number in the field and submit. You should get an error,
   "The page entered is not a number."
 - Enter a number in the field which is greater than the number of pages
   of results. Submitting the form should trigger an error, "The page
   should be a number between 1 and 10."

 - Perform the same tests from the other Z39.50 search results
   interfaces:
   - Acquisitions -> Add to basket -> From an external source.
   - Authorities -> New authority -> New from Z39.50/SRU.

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/z3950_search.js for translation,
  e.g.:

  msgid "The page entered is not a number."
  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: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2020-09-29 08:42:01 UTC
% git grep MSG_LOADING
returns only 2 occurrences in js/z3950_search.js
Comment 5 Owen Leonard 2020-09-29 11:34:52 UTC
Created attachment 110904 [details] [review]
Bug 26291: (follow-up) Correct stray MSG instances
Comment 6 Jonathan Druart 2020-09-29 12:31:42 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Lucas Gass 2020-10-20 17:25:25 UTC
backported to 20.05.x for 20.05.05
Comment 8 Aleisha Amohia 2020-10-27 04:29:28 UTC
enhancement, not backported to 19.11.x