Bug 11263 - New 'locale' setting in subscriptions is not user friendly
Summary: New 'locale' setting in subscriptions is not user friendly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: 3.14
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 7688 11265
Blocks: 11262
  Show dependency treegraph
 
Reported: 2013-11-17 23:06 UTC by Katrin Fischer
Modified: 2014-12-07 20:07 UTC (History)
4 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
screenshot showing locale selection (59.64 KB, image/png)
2013-11-17 23:06 UTC, Katrin Fischer
Details
Bug 11263: locale setting is not user friendly (5.53 KB, patch)
2013-11-19 13:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11263: locale setting is not user friendly (5.52 KB, patch)
2013-11-25 08:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 11263: locale setting is not user friendly (5.76 KB, patch)
2013-11-25 11:36 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 11263: locale setting is not user friendly (5.89 KB, patch)
2013-12-11 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 11263: Use all languages instead of translated only. (2.11 KB, patch)
2013-12-12 10:31 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 Katrin Fischer 2013-11-17 23:06:54 UTC
Created attachment 22990 [details]
screenshot showing locale selection

The locale setting offers you a lot of cryptic choices according to the locales installed on your system. I can imagine that on some servers this list coudl grow even longer.
Comment 1 Katrin Fischer 2013-11-18 10:13:26 UTC
I think this could turn into some kind of bigger problem if you have multiple instances from different countries on one server - the list is already very long with 2 languages (de* and en*).
Comment 2 Jonathan Druart 2013-11-19 13:27:35 UTC Comment hidden (obsolete)
Comment 3 Bernardo Gonzalez Kriegel 2013-11-24 22:54:31 UTC
It works... almost :(

710	          [% IF l.language == locale.language %]

But correct parameter is locale, not locale.language
Changing that line to

710	          [% IF l.language == locale %]

and then works
Comment 4 Bernardo Gonzalez Kriegel 2013-11-24 22:58:48 UTC
(In reply to Bernardo Gonzalez Kriegel from comment #3)
> Changing that line to
On line 710 of koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt

If not, selected locale is not show, as in 11265.

My test was on top of Bug 11265.
Comment 5 Jonathan Druart 2013-11-25 08:26:43 UTC Comment hidden (obsolete)
Comment 6 Bernardo Gonzalez Kriegel 2013-11-25 11:36:52 UTC Comment hidden (obsolete)
Comment 7 Katrin Fischer 2013-11-25 11:48:48 UTC
>New locale is retrieved from installed languages.
>I wonder if that list can be restricted to
>'enabled' ones (parsing syspref language value).

I think listing all installed languages is ok here. I can imagine a library not wanting to enable all the installed languages they want to use for serials. 

Apart from that I still think this could be a good candidate for an authorized value or a small table. Installing languages takes time, updates are often forgotten when you don't actually use them etc. And it would allow for entering "custom" seasons, like abbreviated versions, fall instead of autumn etc.
If we had a pref/tool wherepeople can change it, this could also allow to have other custom patterns.
Comment 8 Galen Charlton 2013-12-05 19:09:31 UTC
(In reply to Katrin Fischer from comment #7)
> Apart from that I still think this could be a good candidate for an
> authorized value or a small table. Installing languages takes time, updates
> are often forgotten when you don't actually use them etc. And it would allow
> for entering "custom" seasons, like abbreviated versions, fall instead of
> autumn etc.
> If we had a pref/tool wherepeople can change it, this could also allow to
> have other custom patterns.

Agreed -- I'm not a big fan of relying on system locales for getting month and day names (with the exception of considering their use for command-line utilities, since one would be logged into the server anyway), for several reasons:

- it creates an extra point of breakage for the naive user
- they can't be customized
- since they don't cover seasons, currently only English and French are supported for season names.  A mechanism that would allow the user to set season names would be trivial to extend to month and day names.
Comment 9 Katrin Fischer 2013-12-11 21:42:16 UTC
Created attachment 23472 [details] [review]
[PASSED QA] Bug 11263: locale setting is not user friendly

The locales list for subscriptions should not be retrieve from the
locales of the system.
This patch retrieves the locales list from the Koha DB (in the same way as
pref language and opaclanguages).

Test plan:
Edit a subscription (or a numbering pattern) and verify the list of
languages is the same as languages available in Koha.
Note: with this patch we loose the saeson translation, it is
normal. See report linked.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. No koha-qa errors.

New locale is retrieved from installed languages.
I wonder if that list can be restricted to
'enabled' ones (parsing syspref language value).

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and all tests.
Works according to description.
Comment 10 Katrin Fischer 2013-12-11 21:43:45 UTC
I am a bit worried about the consequences of this change, requiring
to install templates, that won't be used apart from creating the list.
How could we improve this? Using code similar to how we generate
the list of searchable languages in advanced search maybe? Using a system preference? 
Still going to pass this as this looks like an improvement to me.
Comment 11 Jonathan Druart 2013-12-12 10:28:21 UTC
(In reply to Katrin Fischer from comment #10)
> I am a bit worried about the consequences of this change, requiring
> to install templates, that won't be used apart from creating the list.
> How could we improve this? Using code similar to how we generate
> the list of searchable languages in advanced search maybe? Using a system
> preference? 
> Still going to pass this as this looks like an improvement to me.

Katrin, I used translated languages in order to avoid the long list. But maybe you are right. I am submitting a new followup for getting all languages (as the adv search).
Comment 12 Jonathan Druart 2013-12-12 10:31:00 UTC
Created attachment 23478 [details] [review]
Bug 11263: Use all languages instead of translated only.

This patch produces the same dropdown list as the one in the adv search.
With this way, it won't be necessary to install additional templates to
fill the locale list.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 13 Galen Charlton 2014-05-05 05:07:40 UTC
Pushed to master.  Thanks, Jonathan!