Bug 15301 - Translatability: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence.
Summary: Translatability: branchtransfers.tt: Remove ambiguous "To" and fix splitted s...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-03 21:05 UTC by Marc Véron
Modified: 2017-06-14 22:11 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:


Attachments
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence (5.56 KB, patch)
2015-12-03 21:22 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence (6.95 KB, patch)
2015-12-08 10:35 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence (7.00 KB, patch)
2015-12-08 11:28 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence (7.05 KB, patch)
2015-12-08 12:03 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 15301: (followup) Translatability: branchtransfers.tt (5.08 KB, patch)
2015-12-08 16:14 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence (7.10 KB, patch)
2015-12-08 16:31 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence (7.17 KB, patch)
2015-12-09 08:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence (7.24 KB, patch)
2015-12-29 21:30 UTC, Brendan Gallagher
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2015-12-03 21:05:31 UTC
The file intranet-tmpl/prog/en/modules/circ/branchtransfers.tt contains two ambiguous words 'to' and a sentence splitted up by html tags, leading to weird translations.
Example in German: "Sie können keine Exemplare aus itemtype transferieren BK für: Airfield"
Comment 1 Marc Véron 2015-12-03 21:22:46 UTC Comment hidden (obsolete)
Comment 2 Frédéric Demians 2015-12-07 16:40:16 UTC
Your patch works as described. But the UI change a little bit. Without your
patch, the 'Transferred items' table on branchtransfers.pl page contains 7
columns:

  Title, Author, Barcode, Shelving location, Call number, Type, To

With your patch, the same table contains 6 columns:

  Title, Author, Barcode, Shelving location, Call number, Item type,
  Collection code, Destination

Without your patch, the 'Type' labelled column contains the item type
specified in syspref BranchTransferLimitsType (ccode or item type). With you
patch, both column are simply displayed. It's not an issue from my
perspective. It could even be intersting to display both info there. But it
could be perceived as a regression by some libraries that don't use CCODE for
example.

The use of Administration > Configure columns functionalities could be a
solution in the long run. But in the meantime, couldn't you just add "id" to
the table <th> and <td> tags in order to allow hiding them with JS?
Comment 3 Marc Véron 2015-12-08 10:35:01 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2015-12-08 10:37:41 UTC
Frédéric, I added ids to the th and td tags of the 8 columns only, please let me know if the table itself needs an id as well.
Comment 5 Frédéric Demians 2015-12-08 11:13:52 UTC
(In reply to Marc Véron from comment #4)
> Frédéric, I added ids to the th and td tags of the 8 columns only, please
> let me know if the table itself needs an id as well.

No, its perfect. Just one important detail: it is necessary to have 'class' argument for 'td' tag, and 'id' for 'th'. I can do it if you want. This way 'ccode' column could be hidden with that js:

$('#circ_branchtransfers').ready(function() {
   $('.ccode').hide();
   $('#ccode').hide();
});
Comment 6 Marc Véron 2015-12-08 11:28:38 UTC Comment hidden (obsolete)
Comment 7 Frédéric Demians 2015-12-08 12:03:29 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-12-08 15:17:48 UTC
Comment on attachment 45488 [details] [review]
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence

Review of attachment 45488 [details] [review]:
-----------------------------------------------------------------

::: circ/branchtransfers.pl
@@ +203,4 @@
>              my ( $tbr, $typecode ) = split( /::/,  $messages->{'NotAllowed'} );
>              $err{tbr}      = $branches->{ $tbr }->{'branchname'};
>              $err{code}     = $typecode;
> +            $err{codeType} = C4::Context->preference("BranchTransferLimitsType");

Retrieve it from the template using Koha.Preference

::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt
@@ +175,4 @@
>  		<table>
>              <caption>Transferred items</caption>
>              <tr>
> +                <th id="title">Title</th>

Why do you id an id here?
title, author, ccode, etc. are too much generic.
A class name should be enough (th.title/td.title).
Comment 9 Marc Véron 2015-12-08 16:14:56 UTC Comment hidden (obsolete)
Comment 10 Frédéric Demians 2015-12-08 16:31:17 UTC Comment hidden (obsolete)
Comment 11 Frédéric Demians 2015-12-08 16:32:25 UTC
Marc, I've merged your follow-up with the initial patch for readability purpose.
Comment 12 Marc Véron 2015-12-08 16:57:46 UTC
(In reply to Frédéric Demians from comment #11)
> Marc, I've merged your follow-up with the initial patch for readability
> purpose.

That's perfect, thanks!
Comment 13 Jonathan Druart 2015-12-09 08:27:41 UTC Comment hidden (obsolete)
Comment 14 Brendan Gallagher 2015-12-29 21:30:36 UTC
Created attachment 46036 [details] [review]
Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence

The file intranet-tmpl/prog/en/modules/circ/branchtransfers.tt contains two
ambiguous words 'to' and a sentence splitted up by html tags, leading to weird
translations. Example in German: "Sie können keine Exemplare aus itemtype
transferieren BK für: Airfield"

To test:
- Apply patch

- Set up transfer policies for item types and collection codes in
  Home > Administration > Set library checkin and transfer policy
  Make sure that you have rules that deny and others that allow transfers

- Verify that syspref 'UseBranchTransferLimits' is set to 'Enforce'

- Set 'BranchTransferLimitTypes' to 'item type'

- Go to Home > Circulation > Transfers
- Transfer an item that is allowed for item type
  - Verify that the table of transferred items displays information
    about Item type, Collection code and Destination

- Transfer an item that is not allowed for the item type
  - Verify that the information about not allowing the transfer displays
    properly and is meaningfull

- Set 'BranchTransferLimitTypes' to 'collection code'

- Repeat the transfer steps above for allowed / not allowed collection code

(Amended to add ids to table and 8 columns, see comment #2)
(Amended for comment #5)
Followup for comment #8

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Comment 15 Brendan Gallagher 2015-12-29 21:31:52 UTC
Pushed to master - thanks