Bug 12222 - members-update.tt has a giant hash variable
Summary: members-update.tt has a giant hash variable
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Bernardo Gonzalez Kriegel
QA Contact: Testopia
URL:
Keywords:
Depends on: 12623
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-09 07:59 UTC by paxed
Modified: 2015-06-04 23:33 UTC (History)
5 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:


Attachments
Bug 12222: members-update.tt has a giant hash variable (7.83 KB, patch)
2014-08-11 03:51 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 12222: members-update.tt has a giant hash variable (7.94 KB, patch)
2014-08-11 08:33 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 12222: members-update.tt has a giant hash variable (8.00 KB, patch)
2014-08-22 10:32 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-05-09 07:59:25 UTC
members-update.tt has a giant hash variable that contains the borrowers database table fields, and their clear-text counterparts. This shows up in the po-files as one giant msgid, which is really ugly and unwieldy:

msgid ""
"%s %s [%% SET field_display_names = { surname => \"Surname\" firstname => "
"\"First name\" title => \"Title\" othernames => \"Other names\" initials => "
"\"Initials\" streetnumber => \"Street number\" streettype => \"Street type\" "
"address => \"Address\" address2 => \"Address 2\" city => \"City\" state => "
 etc. for 20 more lines.


This should probably be split into a separate tt include, and changed so only the translatable strings are picked up for translation.
Comment 1 Bernardo Gonzalez Kriegel 2014-08-11 03:51:24 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2014-08-11 03:56:31 UTC
Changed Importance from enhancement to minor, from the perspective of translation this is a bug.
Comment 3 Chris Cormack 2014-08-11 08:33:27 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2014-08-16 20:46:46 UTC
I have problems testing this. When I try to send an update request, I have an error message:

DBIx::Class::Row::new(): No such column 'B_email' on Koha::Schema::Result::BorrowerModification at /home/katrin/kohaclone/Koha/Borrower/Modifications.pm line 63
Comment 5 Katrin Fischer 2014-08-16 20:47:04 UTC
Should add... also happens on master for me, but can't check this works at the moment.
Comment 6 Jonathan Druart 2014-08-22 10:32:18 UTC
Created attachment 31074 [details] [review]
Bug 12222: members-update.tt has a giant hash variable

This patch changes that giant hash by a TT block
to find apropriate strings

To test:
1) Apply the patch
2) On opac log as some user and request some modifications
on personal data
3) On staff, reload main, will see a notice that a patron
has requested modification, clic on the link
4) All modified data must show with apropriate legends
for each db column, check for regressions
5) Update translation files for your preferred language, xx-YY
Check for new strings, e.g.
egrep "Alternate address" misc/translator/po/xx-YY*
You must find old and new instances
(old with #~ , in particular the hash one)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Works as advertised, strings are now translatable.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Jonathan Druart 2014-08-22 10:32:53 UTC
Works great with patch on bug 12623.
Comment 8 Tomás Cohen Arazi 2014-08-26 13:33:07 UTC
Patch pushed to master.

Thanks Bernardo!

I'd prefer to have the field names read from columns.def instead, please take a look at C4::Templates::GetColumnDefs. Important improvement anyway.