Bug 8954 - Languages list in advanced search always in english
Summary: Languages list in advanced search always in english
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low normal
Assignee: Fridolin Somers
QA Contact: Paul Poulain
URL:
Keywords:
Depends on:
Blocks: 9056
  Show dependency treegraph
 
Reported: 2012-10-22 14:55 UTC by Mathieu Saby
Modified: 2013-12-05 20:01 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
[PATCH] Bug 8954: Make languages list in advanced search translatable (3.26 KB, patch)
2012-10-22 14:58 UTC, Mathieu Saby
Details | Diff | Splinter Review
Proposed patch 2 (3.27 KB, patch)
2012-10-31 08:24 UTC, Fridolin Somers
Details | Diff | Splinter Review
[PATCH] Bug 8954: Make languages list in advanced search translatable (revision 1) (6.34 KB, patch)
2012-11-09 00:00 UTC, Mathieu Saby
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8954: Make languages list in advanced search translatable (revision 1) (6.76 KB, patch)
2012-11-10 09:14 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED OFF] Bug 8954: Make languages list in advanced search translatable (revision 1) (6.99 KB, patch)
2012-11-17 22:10 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 8954: Make languages list in advanced search translatable (revision 1) (7.04 KB, patch)
2012-11-20 15:00 UTC, Paul Poulain
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8945: Did you mean help file (2.36 KB, patch)
2012-12-03 22:04 UTC, Marc Véron
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Saby 2012-10-22 14:55:36 UTC
Hi
In opac-search.pl and search.pl, language names in the dropdown list are always in english (+ native name), even in your GUI is translated in an other language : Arabic, Bulgarian, etc.

Mathieu Saby
Rennes 2 University
Comment 1 Mathieu Saby 2012-10-22 14:58:04 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2012-10-25 18:25:20 UTC
After applying this patch and switching from English to French I see no languages at all. From the output of the OPAC page:

<select id="language-limit" name="limit">
<option value="">Sans limite</option>
<option value="ln,rtrn:"></option>
<option value="ln,rtrn:"></option>
<option value="ln,rtrn:"></option>

The languages do appear as before when I'm in English mode.
Comment 3 Mathieu Saby 2012-10-26 07:38:29 UTC
Thank you for testing. That's bad...
I will try to correct that this afternoon.

M. Saby
Comment 4 Mathieu Saby 2012-10-26 17:23:42 UTC
Why it is not working :
1. in C4/Languages.pm, the sub getAllanguages can get a parameter, whose value is assigned to the variable $current_language. If no parameter, $current_language gets the value 'en'.
Then the sub search for $current_language in "lang" column of  language_descriptions table. If $current_language does not match any value in this column, the sub does not search english language name (as I thought.). So no languages are showing in the resulting list in html.

2. In this table, the only 2 values in lang colum are currently "en" and "fr".
But in opac-search.pl and opac-pl, I pass as a parameter the value given C4::Templates::getlanguages. For a french template, it is "fr-FR", and not "fr".


So it is more complicated as I first thought, and I don't know how to resolve these 2 issues for the moment. If somebody has an idea...

Mathieu Saby
Rennes 2 University
Comment 5 Fridolin Somers 2012-10-31 08:24:42 UTC Comment hidden (obsolete)
Comment 6 Mathieu Saby 2012-10-31 08:59:00 UTC
Thank you Fridolyn.
I was considering either your solution, or to change the "fr" to "fr-FR" in the database...

I will test, and check if it works in french translated interface.

I suppose there will probably still be a problem if koha interface is translated in an other langage. I'll check and make an other corrective patch if needed.

Mathieu Saby
Rennes 2 University
Comment 7 Fridolin Somers 2012-10-31 11:25:33 UTC
(In reply to comment #6)
> I suppose there will probably still be a problem if koha interface is
> translated in an other langage.

Yes, your right.
I think we should make a query on both $lang and 'en' and use the first result.
Comment 8 Mathieu Saby 2012-11-09 00:00:35 UTC Comment hidden (obsolete)
Comment 9 Marc Véron 2012-11-10 09:14:30 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2012-11-17 22:10:25 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2012-11-17 22:11:02 UTC
Comment on attachment 13371 [details] [review]
[SIGNED-OFF] Bug 8954: Make languages list in advanced search translatable (revision 1)

Adding another sign-off. This patch includes no string changes.
Comment 12 Mathieu Saby 2012-11-17 22:24:12 UTC
Marc & Katrin, thank you for signing off!

Mathieu Saby
Comment 13 Paul Poulain 2012-11-20 15:00:12 UTC
QA comment:
 * C4/Language.pm is the dirtiest code we've into Koha. It does hundreds of SQL queries on each page. That must be THE place to optimize after 3.10 (I plan to try to do something for that). This patch add more SQL, that's bad, but I've no counter proposal, so it's OK
 * passes koha-qa.pl
 * works as announced

passed QA
Comment 14 Paul Poulain 2012-11-20 15:00:32 UTC Comment hidden (obsolete)
Comment 15 Mathieu Saby 2012-11-20 15:26:55 UTC
@Paul :
Regarding languages in Koha, I don't understand why we have a list in authorized values, AND an other list made of THREE tables.

It is a nightmare to understand, to test, to correct and to improve. Not to speak of internationalisation!
For example, I wanted to create a new facet for languages. But what list should I use ? The list in authorised values is not translatable, but the 3-tables-list is more complete, and translatable (in the HARD way : adding new names in sql tables).

Mathieu
Comment 16 Mathieu Saby 2012-11-20 15:29:14 UTC
Oups, of course, I mean the 3-table list is less complete than the authorized values list.
Mathieu
Comment 17 Katrin Fischer 2012-11-20 15:39:10 UTC
Hi Mathieu,

I think the LANG authorised value might be specific to UNIMARC. There is no sample data for language codes for German or en (afaik). The good thing about language is, that they are pretty static. So perhaps the sql tables are not that bad and when someone tells us about a missing language or translation we can help getting it right.

I think one of the bigger problems we have with the sql data is, that we need one file for each translated installer - that's horrible to maintain. There should be one central file for all lanugages (see discussion on bug 9056)
Comment 18 Mathieu Saby 2012-11-20 15:43:32 UTC
Thank you Katrin
I think in french unimarc the LANG authorised values are used 
- for cataloguing 
- for "translating" iso codes into french when koha display a record in opac and in staff interface.
So I thought it was universal...

I will take a look at bz9056

Mathieu
Comment 19 Jared Camins-Esakov 2012-11-20 19:48:00 UTC
This patch has been pushed to master. I fixed a small typo in the POD (a missing semicolon) when pushing.
Comment 20 Paul Poulain 2012-11-22 15:40:42 UTC
Patch pushed to branch 3.10.x
Comment 21 Chris Cormack 2012-11-26 00:29:24 UTC
Pushed this fix to 3.8.x also, will be in 3.8.8
Comment 22 Liz Rea 2012-11-28 22:42:22 UTC
Pushed to 3.6.x will be in 3.6.11.
Comment 23 Marc Véron 2012-12-03 22:04:01 UTC Comment hidden (obsolete)
Comment 24 Katrin Fischer 2012-12-04 05:32:34 UTC
Hi Marc, I think you had a little typo in the bug number- could you attach your signed off patch to 8945? Thanks!
Comment 25 Katrin Fischer 2012-12-04 05:49:25 UTC
Comment on attachment 13860 [details] [review]
[SIGNED-OFF] Bug 8945: Did you mean help file

I see now, that this has already been done - obsoleting wrong patch here :)
Comment 26 Marc Véron 2012-12-04 06:21:31 UTC
Sorry, it was late...  :-)