Bug 20115

Summary: Languages appear in a different order in the footer
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: I18N/L10NAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: normal    
Priority: P5 - low CC: dilan, f.demians, J.P.Knight, josef.moravec, martin.renvoize, nick, severine.queune
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
The languages displayed in the footer are now displayed in the same order as they are in the system preferences languages and opaclanguages (they can be reordered by drag and drop).
Version(s) released in:
Bug Depends on:    
Bug Blocks: 20116    
Attachments: Bug 20115: Set the languages order with the pref values
Bug 20115: Make the prefs sortable
Bug 20115: Trigger "modified" when sort is changed
Bug 20115: Remove sort on rfc4646_subtag in OPAC templates
Bug 20115: Set the languages order with the pref values
Bug 20115: Make the prefs sortable
Bug 20115: Trigger "modified" when sort is changed
Bug 20115: Remove sort on rfc4646_subtag in OPAC templates
Bug 20115: Add information about this feature in the pref descriptions
Bug 20115: Set the languages order with the pref values
Bug 20115: Make the prefs sortable
Bug 20115: Trigger "modified" when sort is changed
Bug 20115: Remove sort on rfc4646_subtag in OPAC templates
Bug 20115: Add information about this feature in the pref descriptions

Description Jonathan Druart 2018-01-31 18:09:55 UTC
The language chooser displays languages in a different order when the page is refresh. It should stick to the same order.
A default order can depend on the pref values.
Comment 1 Jonathan Druart 2018-01-31 18:17:09 UTC
Created attachment 71094 [details] [review]
Bug 20115: Set the languages order with the pref values

To avoid the languages to be ordered randomly, it is better to stick on
a default order.
Let's suppose that the order in the pref is correct.
Comment 2 Jonathan Druart 2018-01-31 18:17:13 UTC
Created attachment 71095 [details] [review]
Bug 20115: Make the prefs sortable

If we depend on the order, we should make it sortable.

I let the customization to someone else (we would need an icon to tell
the user it's sortable).

Something does not work here:
If fr-FR and fr-CA is installed, but only 1 is ticked, it will be
considered as last. I do not think it's a blocker as it does not make
really make sense to have it installed but not used (the interface is
also weird, there is a dropdown list with only 1 entry)
Comment 3 Jonathan Druart 2018-01-31 18:17:16 UTC
Created attachment 71096 [details] [review]
Bug 20115: Trigger "modified" when sort is changed
Comment 4 Jonathan Druart 2018-01-31 18:17:41 UTC
*** Bug 20094 has been marked as a duplicate of this bug. ***
Comment 5 Jon Knight 2018-02-05 12:14:51 UTC
Is there a test plan for this?  I loaded en-NZ and de-DE translations onto my Kohadevbox but the order still seems pretty random (its different between the staff and the OPAC for example, even after doing a restart_all and refreshing both web pages).  Or is it random because the sorting in the syspref isn't written yet? Is that part of this bug (in which case it can't be signed off really) or should it be considered as a separate bug that this one depends on?
Comment 6 Jonathan Druart 2018-02-05 13:46:11 UTC
I retest and everything looks ok.

You need to
1. Install the patch
2. Install or update new languages, for instance:
  sudo koha-translate --install en-NZ --dev kohadev
  sudo koha-translate --install fr-FR --dev kohadev
  sudo koha-translate --install es-ES --dev kohadev
3. Restart all (memcached, plack)

Test plan:
Search for "language" in the I18N/L10N syspref section and tick/untick and reorder the values as you wish.

On the OPAC and staff interfaces you should see the languages displayed with the same order as the pref, and preserved from one reload to the other
Comment 7 Dilan Johnpullé 2018-02-15 06:15:29 UTC
Works as described on the staff client side but the order on the opac side remains unchanged regardless of the order of languages set.
Comment 8 Jonathan Druart 2018-02-15 14:44:25 UTC
Created attachment 71661 [details] [review]
Bug 20115: Remove sort on rfc4646_subtag in OPAC templates
Comment 9 Jonathan Druart 2018-02-15 14:45:25 UTC
(In reply to Dilan Johnpullé from comment #7)
> Works as described on the staff client side but the order on the opac side
> remains unchanged regardless of the order of languages set.

True, good catch Dilan. There was another sort in the template, I removed it.
Comment 10 Dilan Johnpullé 2018-03-05 02:41:01 UTC
Hi Jonathan I've tested the patch again and the OPAC appears to still be displaying language options completely randomly. I have attempted restarting plack and emptying my cache to no avail.
Comment 11 Jesse Maseto 2018-03-16 12:03:31 UTC
Created attachment 73027 [details] [review]
Bug 20115: Set the languages order with the pref values

To avoid the languages to be ordered randomly, it is better to stick on
a default order.
Let's suppose that the order in the pref is correct.

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Comment 12 Jesse Maseto 2018-03-16 12:03:46 UTC
Created attachment 73028 [details] [review]
Bug 20115: Make the prefs sortable

If we depend on the order, we should make it sortable.

I let the customization to someone else (we would need an icon to tell
the user it's sortable).

Something does not work here:
If fr-FR and fr-CA is installed, but only 1 is ticked, it will be
considered as last. I do not think it's a blocker as it does not make
really make sense to have it installed but not used (the interface is
also weird, there is a dropdown list with only 1 entry)

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Comment 13 Jesse Maseto 2018-03-16 12:03:50 UTC
Created attachment 73029 [details] [review]
Bug 20115: Trigger "modified" when sort is changed

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Comment 14 Jesse Maseto 2018-03-16 12:03:55 UTC
Created attachment 73030 [details] [review]
Bug 20115: Remove sort on rfc4646_subtag in OPAC templates

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Comment 15 Josef Moravec 2018-03-29 11:22:21 UTC
Jonathan, it's great feature and works perfectly. Just one small thing: I think that the ability to sort (and the information that the sorted system preference matter) should be descriped on system preference.
Comment 16 Jonathan Druart 2018-03-29 15:15:02 UTC
Created attachment 73433 [details] [review]
Bug 20115: Add information about this feature in the pref descriptions

I guess a native English speaker will have a better wording :)
Comment 17 Josef Moravec 2018-04-04 11:22:00 UTC
Created attachment 73610 [details] [review]
Bug 20115: Set the languages order with the pref values

To avoid the languages to be ordered randomly, it is better to stick on
a default order.
Let's suppose that the order in the pref is correct.

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 18 Josef Moravec 2018-04-04 11:22:04 UTC
Created attachment 73611 [details] [review]
Bug 20115: Make the prefs sortable

If we depend on the order, we should make it sortable.

I let the customization to someone else (we would need an icon to tell
the user it's sortable).

Something does not work here:
If fr-FR and fr-CA is installed, but only 1 is ticked, it will be
considered as last. I do not think it's a blocker as it does not make
really make sense to have it installed but not used (the interface is
also weird, there is a dropdown list with only 1 entry)

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 19 Josef Moravec 2018-04-04 11:22:08 UTC
Created attachment 73612 [details] [review]
Bug 20115: Trigger "modified" when sort is changed

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 20 Josef Moravec 2018-04-04 11:22:11 UTC
Created attachment 73613 [details] [review]
Bug 20115: Remove sort on rfc4646_subtag in OPAC templates

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 21 Josef Moravec 2018-04-04 11:22:16 UTC
Created attachment 73614 [details] [review]
Bug 20115: Add information about this feature in the pref descriptions

I guess a native English speaker will have a better wording :)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 22 Jonathan Druart 2018-04-04 19:08:24 UTC
Pushed to master for 18.05, thanks to everybody involved!