Bug 2832 - Make alphabet localizable
Summary: Make alphabet localizable
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: 3.12
Hardware: All All
: P3 enhancement (vote)
Assignee: Magnus Enger
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-01 12:26 UTC by Chris Cormack
Modified: 2013-12-05 20:04 UTC (History)
8 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 2832 - Make alphabet localizable (6.29 KB, patch)
2012-10-10 14:46 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 2832 - Make alphabet localizable (6.38 KB, patch)
2012-10-18 23:44 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 2832 - Make alphabet localizable (6.34 KB, patch)
2012-10-20 22:17 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 2832: Followup: Add a default value (865 bytes, patch)
2012-10-24 14:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 2832: [SIGNED-OFF] Followup: Add a default value (966 bytes, patch)
2012-10-30 15:22 UTC, Magnus Enger
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 00:56:57 UTC


---- Reported by axelb@skolelinux.no 2008-12-01 12:26:39 ----

The string:
Browse by last name: <a1>A</a> <a2>B</a> <a3>C</a> <a4>D</a> <a5>E</a> 
<a6>F</a> <a7>G</a> <a8>H</a> <a9>I</a> <a10>J</a> <a11>K</a> <a12>L</a> 
<a13>M</a> <a14>N</a> <a15>O</a> <a16>P</a> <a17>Q</a> <a18>R</a> <a19>S</a> 
<a20>T</a> <a21>U</a> <a22>V</a> <a23>W</a> <a24>X</a> <a25>Y</a> <a26>Z</a>
could not be extended, we had to use the exact same number of letters as in english, thus we had to write:
Bla etter etternamn: <a1>A</a> <a2>B</a> <a3>C</a> <a4>D</a> <a5>E</a> 
<a6>F</a> <a7>G</a> <a8>H</a> <a9>I</a> <a10>J</a> <a11>K</a> <a12>L</a> 
<a13>M</a> <a14>N</a> <a15>O</a> <a16>P</a> <a17>Q</a> <a18>R</a> <a19>S</a> 
<a20>T</a> <a21>U</a> <a22>V</a> <a23>W</a> <a24>X</a> <a25>Y</a> 
<a26>Z&ndash;Å</a>
... although «Z--Å» are all the letters: z, æ, ø and å.
It ought to be possible to add or remove letters from this list without getting an error message (as we did).



---- Additional Comments From oleonard@myacpl.org 2008-12-06 08:34:33 ----

Personally, I find these search-by-letter links to be of little use. My vote is to remove them altogether.



---- Additional Comments From nengard@gmail.com 2009-12-23 17:59:52 ----

This bug hasn't been touched in nearly a year, please revisit and test and close if appropriate.



---- Additional Comments From oleonard@myacpl.org 2009-12-29 01:21:42 ----

Still an issue. Does anyone find the "browse" alphabet links useful?



---- Additional Comments From nengard@gmail.com 2009-12-29 02:38:05 ----

I'm not working in a library - but I use the links all of the time - and now that there is a filter option it makes them a bit easier to manage in big libraries - I would think - but like I said I'm not working in a library.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:56 UTC  ---

This bug was previously known as _bug_ 2832 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2832

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was axelb@skolelinux.no.

Comment 1 Magnus Enger 2011-05-17 12:40:10 UTC
Would it be possible to turn the alphabet into a syspref, so that the default is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', but e.g. Norwegian installations could change it to 'ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ'? Wherever an alhpabet is needed, this string could then be split into single characters, and the necessary links generated, e.g.: 

<a href="/cgi-bin/koha/members/member.pl?quicksearch=1&amp;surname=A">A</a>
<a href="/cgi-bin/koha/members/member.pl?quicksearch=1&amp;surname=B">B</a>
<a href="/cgi-bin/koha/members/member.pl?quicksearch=1&amp;surname=C">C</a>
...
<a href="/cgi-bin/koha/members/member.pl?quicksearch=1&amp;surname=Æ">Æ</a>
<a href="/cgi-bin/koha/members/member.pl?quicksearch=1&amp;surname=Ø">Ø</a>
<a href="/cgi-bin/koha/members/member.pl?quicksearch=1&amp;surname=Å">Å</a>

Are browsable alphabets like this used on any other pages than members/members-home.pl?
Comment 2 Magnus Enger 2011-05-17 12:51:05 UTC
(In reply to comment #1)
> Would it be possible to turn the alphabet into a syspref, so that the default
> is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', but e.g. Norwegian installations could change
> it to 'ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ'? 

...and of course leaving the syspref empty could turn off the whole "Browse by last name" feature.
Comment 3 Owen Leonard 2011-05-17 19:31:23 UTC
(In reply to comment #1)
> Would it be possible to turn the alphabet into a syspref, so that the default
> is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', but e.g. Norwegian installations could change
> it to 'ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ'?

I like this idea.

> Are browsable alphabets like this used on any other pages than
> members/members-home.pl?

No, but it might be nice to have it in other places: Vendor names, for instance?
Comment 4 Serhij Dubyk 2011-10-18 19:50:14 UTC
(In reply to comment #1)
> Would it be possible to turn the alphabet into a syspref, so that the default
> is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', but e.g. Norwegian installations could change
> it to 'ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ'? 

Also vote for such syspref. For cyrillic libraries latin string often not usefull, need something like АБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯ (Ukrainian alphabets). Also will be possible some mixtures (if many foreign students).
Comment 5 Chris Cormack 2012-08-24 03:54:52 UTC
I like the idea of a syspref too ... now we just need someone to write the code :)
Comment 6 Magnus Enger 2012-10-10 13:00:30 UTC
(In reply to comment #5)
> I like the idea of a syspref too ... now we just need someone to write the
> code :)

I'll take a stab at it.
Comment 7 Magnus Enger 2012-10-10 14:46:27 UTC Comment hidden (obsolete)
Comment 8 Magnus Enger 2012-10-10 14:48:51 UTC
Using a non-delimited string of characters as first described did not work, because split() divided chars like Æ into two separate thingies, as described here: http://www.effectiveperlprogramming.com/blog/1286 A space delimited string is less elegant, but should get the job done.
Comment 9 Mirko Tietgen 2012-10-18 23:44:44 UTC Comment hidden (obsolete)
Comment 10 Mirko Tietgen 2012-10-18 23:49:10 UTC
Tested with mildly crazy cyrillic (kildin saami), IPA and others. Finally I am able to browse people like Hans ʘ͡qrder :) Works as expected, did not manage to break it.
Comment 11 Mirko Tietgen 2012-10-20 22:17:46 UTC
Created attachment 12981 [details] [review]
Bug 2832 - Make alphabet localizable

Adds the "alphabet" syspref, which can hold a space separated list
of charachters, which can be expanded into browse links when needed.

To test:
- Make sure to run updatedatabase
- Check that the "alphabet" syspref was added under "I18N/L10N preferences"
- Check that browse links are displayed Home › Patrons
- Add some weird charachters like ÆØÅ to "alphabet" and check that the
  browse links are still displayed ok

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Comment 12 Jonathan Druart 2012-10-24 14:23:12 UTC
QA Comment:
If the syspref is empty, I have a "Browse by last name:".
Either we display nothing or we display a default value.
I will proposed a little patch for the second option.
Fell free to propose another one :)
Comment 13 Jonathan Druart 2012-10-24 14:23:28 UTC Comment hidden (obsolete)
Comment 14 Magnus Enger 2012-10-30 15:22:27 UTC
Created attachment 13119 [details] [review]
Bug 2832: [SIGNED-OFF] Followup: Add a default value

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Makes sense, and works as advertised.
Comment 15 Magnus Enger 2012-10-30 15:23:04 UTC
Comment on attachment 13021 [details] [review]
Bug 2832: Followup: Add a default value

Replaced by signed off patch.
Comment 16 Magnus Enger 2012-10-30 15:23:41 UTC
Both patches are now signed off.
Comment 17 Jonathan Druart 2012-10-30 15:50:07 UTC
Marked as Passed QA
Comment 18 Jared Camins-Esakov 2012-10-31 21:14:18 UTC
This feature will go into 3.12 since it introduces string changes and the 3.10 string freeze has already begun.
Comment 19 Jared Camins-Esakov 2012-11-23 16:53:54 UTC
This patch has been pushed to master.
Comment 20 Magnus Enger 2012-11-26 14:56:20 UTC
Looks like the followup (attachment 13119 [details] [review]) has not been pushed.
Comment 21 Magnus Enger 2012-11-26 15:02:06 UTC
Changing the status so the followup does not get missed.
Comment 22 Jared Camins-Esakov 2012-11-28 13:30:01 UTC
This patch has been pushed to master.
Comment 23 Magnus Enger 2013-03-24 09:42:07 UTC
Works nicely in master.