Bug 34035 - Move translatable strings out of opac-bottom.inc: Tags
Summary: Move translatable strings out of opac-bottom.inc: Tags
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 21156 34034
Blocks: 34082
  Show dependency treegraph
 
Reported: 2023-06-16 13:03 UTC by Owen Leonard
Modified: 2024-07-04 20:37 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00
Circulation function:


Attachments
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags (10.10 KB, patch)
2023-06-16 13:58 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34035: (preparatory cleanup) Convert indentation to spaces. (6.55 KB, patch)
2023-06-21 14:53 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags (10.09 KB, patch)
2023-06-21 14:53 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34035: (preparatory cleanup) Convert indentation to spaces. (6.55 KB, patch)
2023-06-21 15:55 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags (10.65 KB, patch)
2023-06-21 15:55 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34035: (preparatory cleanup) Convert indentation to spaces. (6.60 KB, patch)
2023-10-07 19:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags (10.70 KB, patch)
2023-10-07 19:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 34035: (preparatory cleanup) Convert indentation to spaces. (6.65 KB, patch)
2023-10-08 14:15 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags (10.76 KB, patch)
2023-10-08 14:15 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 Owen Leonard 2023-06-16 13:03:16 UTC
Several strings are defined in opac-bottom.inc for use the tags feature. These can be moved to the corresponding JavaScript file.
Comment 1 Owen Leonard 2023-06-16 13:58:31 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2023-06-21 14:53:43 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2023-06-21 14:53:46 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2023-06-21 15:55:48 UTC
Created attachment 152529 [details] [review]
Bug 34035: (preparatory cleanup) Convert indentation to spaces.

This patch converts tabs to spaces in tags.js. No other changes are
made.
Comment 5 Owen Leonard 2023-06-21 15:55:51 UTC
Created attachment 152530 [details] [review]
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags

This patch removes the definition of JS variables in opac-bottom.inc
related to the tags feature. These strings can be wrapped in the __()
function inside tags.js and they'll get picked up for translation.

Some other tags-related JS variable definitions are removed from
templates in favor of embedding them directly in the <script> block.

To test you must have TagsEnabled set to "Allow." Apply the patch and
log in to the OPAC.

- Perform a catalog search and select some items in the result list.
  - Add the items to the cart and open the cart.
    - Check a box next to one of the titles in the cart.
    - Click the "Tag" link
    - Submit the "New tag" form without entering a tag. You should see
      "No tag was specified."
    - Perform the same test on the search results page both using the
      checkboxes and by clicking the "Add tag" link on an individual
      result.
  - Perform the same test on the bibliographic detail page.
  - When adding tags from the cart, result list, or detail page, confirm
    that the "Tags added: X" message is always displayed.
  - Test adding a tag to a title which is already attached to that
    title.
  - Test adding HTML markup, e.g. "<script>"
  - Test adding HTML markup and plain text, e.g. "<script>Foo"
Comment 6 David Nind 2023-10-07 19:13:36 UTC
Created attachment 156698 [details] [review]
Bug 34035: (preparatory cleanup) Convert indentation to spaces.

This patch converts tabs to spaces in tags.js. No other changes are
made.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2023-10-07 19:13:39 UTC
Created attachment 156699 [details] [review]
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags

This patch removes the definition of JS variables in opac-bottom.inc
related to the tags feature. These strings can be wrapped in the __()
function inside tags.js and they'll get picked up for translation.

Some other tags-related JS variable definitions are removed from
templates in favor of embedding them directly in the <script> block.

To test you must have TagsEnabled set to "Allow." Apply the patch and
log in to the OPAC.

- Perform a catalog search and select some items in the result list.
  - Add the items to the cart and open the cart.
    - Check a box next to one of the titles in the cart.
    - Click the "Tag" link
    - Submit the "New tag" form without entering a tag. You should see
      "No tag was specified."
    - Perform the same test on the search results page both using the
      checkboxes and by clicking the "Add tag" link on an individual
      result.
  - Perform the same test on the bibliographic detail page.
  - When adding tags from the cart, result list, or detail page, confirm
    that the "Tags added: X" message is always displayed.
  - Test adding a tag to a title which is already attached to that
    title.
  - Test adding HTML markup, e.g. "<script>"
  - Test adding HTML markup and plain text, e.g. "<script>Foo"

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2023-10-07 19:23:09 UTC
Testing notes (using KTD):

- Needed to enable the TagsInputOnList system preference as well.
Comment 9 Katrin Fischer 2023-10-08 14:15:31 UTC
Created attachment 156710 [details] [review]
Bug 34035: (preparatory cleanup) Convert indentation to spaces.

This patch converts tabs to spaces in tags.js. No other changes are
made.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2023-10-08 14:15:34 UTC
Created attachment 156711 [details] [review]
Bug 34035: Move translatable strings out of opac-bottom.inc: Tags

This patch removes the definition of JS variables in opac-bottom.inc
related to the tags feature. These strings can be wrapped in the __()
function inside tags.js and they'll get picked up for translation.

Some other tags-related JS variable definitions are removed from
templates in favor of embedding them directly in the <script> block.

To test you must have TagsEnabled set to "Allow." Apply the patch and
log in to the OPAC.

- Perform a catalog search and select some items in the result list.
  - Add the items to the cart and open the cart.
    - Check a box next to one of the titles in the cart.
    - Click the "Tag" link
    - Submit the "New tag" form without entering a tag. You should see
      "No tag was specified."
    - Perform the same test on the search results page both using the
      checkboxes and by clicking the "Add tag" link on an individual
      result.
  - Perform the same test on the bibliographic detail page.
  - When adding tags from the cart, result list, or detail page, confirm
    that the "Tags added: X" message is always displayed.
  - Test adding a tag to a title which is already attached to that
    title.
  - Test adding HTML markup, e.g. "<script>"
  - Test adding HTML markup and plain text, e.g. "<script>Foo"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Tomás Cohen Arazi (tcohen) 2023-10-09 14:42:49 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 12 Fridolin Somers 2023-10-09 18:43:20 UTC
Enhancement not pushed to 23.05.x