Bug 13351 - Untranslatable javascript in members.tt
Summary: Untranslatable javascript in members.tt
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-26 20:56 UTC by Héctor Eduardo Castro Avalos
Modified: 2015-12-03 22:02 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: String patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13351 - Untranslatable javascript in members.tt (2.96 KB, patch)
2015-03-03 10:56 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 13351 - Untranslatable javascript in members.tt (3.02 KB, patch)
2015-03-03 17:09 UTC, Mirko Tietgen
Details | Diff | Splinter Review
[PASSED QA] Bug 13351 - Untranslatable javascript in members.tt (3.17 KB, patch)
2015-03-05 13:10 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 Héctor Eduardo Castro Avalos 2014-11-26 20:56:43 UTC
Untranslatable javascript in /koha-tmpl/intranet-tmpl/prog/en/members/members.tt line 243 "for patron", and line 225 "on " and "fields "
Comment 1 paxed 2014-11-27 06:20:14 UTC
The file name is koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt

The whole update_searched() javascript function should be redone with i18n in mind - using format() and %s placeholders instead of concatenating strings.
Comment 2 Héctor Eduardo Castro Avalos 2014-11-27 15:04:26 UTC
(In reply to paxed from comment #1)

See Coding Guidelines at <http://wiki.koha-community.org/wiki/Coding_Guidelines#JS2:_Enabling_translation_of_language_strings_in_embedded_JavaScript> in JS2 Section. Maybe need to be wrapped to the special funciton _().


> The file name is koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
> 
> The whole update_searched() javascript function should be redone with i18n
> in mind - using format() and %s placeholders instead of concatenating
> strings.
Comment 3 Marc Véron 2015-03-03 10:43:37 UTC
To reproduce:

Go to Home > Patrons (cgi-bin/koha/members/members-home.pl)
- Switch language e.g. to German
- Use filter and fill all fields

You get a result like:

Treffer gefunden for patron on standard fields beginnend mit Nepomuk mit Kategorie Erwachsener in der Bibliothek Allschwil

Hmm, English version looks weird too:

Results found for patron on borrower number fields starting with 1 with category Staff in library Fairview

Something like the following would look better and would be better to translate:

Patrons found for: Standard containing 'A' with category 'Adult' in library Airfield
Comment 4 Marc Véron 2015-03-03 10:56:51 UTC Comment hidden (obsolete)
Comment 5 Mirko Tietgen 2015-03-03 17:09:28 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2015-03-05 13:10:46 UTC
Created attachment 36579 [details] [review]
[PASSED QA] Bug 13351 - Untranslatable javascript in members.tt

This patch streamlines the page title text for search results in Home > Patrons to make it translateable (and more readable).

To test:
- Apply patch
- Select Englsh language
- Apply filter wit several values or click on a letter for "Browse by last name"
- Verify that the title makes sense
- Translate to your language and select this language
- Verify that the text appears properly in your language

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, no problems found.

http://bugs.koha-community.org/show_bug.cgi?id=13352
Comment 7 paxed 2015-03-09 06:08:25 UTC
Pity the patch doesn't use the javascript .format() function, but just concatenates strings together. Bad sentence structures it makes.
Comment 8 Tomás Cohen Arazi 2015-03-10 19:55:26 UTC
Patch pushed to master.

Thanks Marc!
Comment 9 Chris Cormack 2015-03-13 22:29:18 UTC
Pushed to 3.18.x will be in 3.18.5