Libraries should be able to control the priority of languages in the advanced search drop-down list. This could be achieved by sorting them according to the AdvancedSearchLanguages system preference.
Created attachment 42914 [details] [review] Bug 14912: Sort Advanced Search Languages by priority Libraries should be able to control the priority of languages in the advanced search drop-down list. This could be achieved by sorting them according to the AdvancedSearchLanguages system preference. To test: -1. Set some languages into AdvancedSearchLanguages system preference 1. Go to advanced search and look at Languages drop-down list 2. Note that the list is in alphabetical order 3. Apply patch 4. Repeat step 1 5. Note that the list is sorted like AdvancedSearchLanguages
Created attachment 42915 [details] [review] Bug 14912: Sort Advanced Search Languages by priority
Created attachment 42944 [details] [review] Bug 14912: Sort Advanced Search Languages by priority Libraries should be able to control the priority of languages in the advanced search drop-down list. This could be achieved by sorting them according to the AdvancedSearchLanguages system preference. To test: -1. Set some languages into AdvancedSearchLanguages system preference 1. Go to advanced search and look at Languages drop-down list 2. Note that the list is in alphabetical order 3. Apply patch 4. Repeat step 1 5. Note that the list is sorted like AdvancedSearchLanguages Works as expected Signed-off-by: Marc Véron <veron@veron.ch>
I am not sure about this solution - it removes the option to have alphabetic sorting AND a limited list of language options. Even if you sort the entries in AdvancedSearchLanguages correct for one language, it will be wrong for another.
(In reply to Katrin Fischer from comment #4) > I am not sure about this solution - it removes the option to have alphabetic > sorting AND a limited list of language options. Even if you sort the entries > in AdvancedSearchLanguages correct for one language, it will be wrong for > another. Good point. I guess the solution would be to have an additional sysypref, something like SortAdvancedSearchLanguages [Alphabetically | As defined]
Yes, that would make sense to me.
Created attachment 43251 [details] [review] Bug 14912: (follow-up) Use priority sorting only if AdvancedSearchLanguagesSort is set to priority. This patch adds a system preference "AdvancedSearchLanguagesSort" that defines whether the drop-down list should be sorted by priority in AdvancedSearchLanguages or alphabetically like before. To test: -1. Set some languages into AdvancedSearchLanguages system preference 1. Go to advanced search and look at Languages drop-down list 2. Note that the list is in alphabetical order 3. Apply patches and run database update 4. Change system preference AdvancedSearchLanguagesSort to "by priority" 5. Repeat step 1 6. Note that the list is sorted like AdvancedSearchLanguages 7. Change system preference AdvancedSearchLanguagesSort to "alphabetically" 8. Repeat step 1 9. Note that the list is again in alphabetical order
Hi Lari, It seems that the alphabetical order uses the English language names and not the (translated) names, is that the case? I have: fre|eng|ger Order: alphabetically and I get E-D-F instead of D-E-F: English (English) Deutsch (German) Français (French)
Created attachment 43333 [details] [review] Bug 14912: (follow-up) Use priority sorting only if AdvancedSearchLanguagesSort is set to priority. This patch adds a system preference "AdvancedSearchLanguagesSort" that defines whether the drop-down list should be sorted by priority in AdvancedSearchLanguages or alphabetically like before. To test: -1. Set some languages into AdvancedSearchLanguages system preference 1. Go to advanced search and look at Languages drop-down list 2. Note that the list is in alphabetical order 3. Apply patches and run database update 4. Change system preference AdvancedSearchLanguagesSort to "by priority" 5. Repeat step 1 6. Note that the list is sorted like AdvancedSearchLanguages 7. Change system preference AdvancedSearchLanguagesSort to "alphabetically" 8. Repeat step 1 9. Note that the list is again in alphabetical order Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Works as expected
Marc, I tried some combinations, including the one you wrote about, but I have no problems with sorting. Is it possible that something else comes into effect?
Lari, Don't you think it would be better to have the 2 prefs on the same line (Same as OpacSeparateHoldings and OpacSeparateHoldingsBranch)?
(In reply to Josef Moravec from comment #10) > Marc, I tried some combinations, including the one you wrote about, but I > have no problems with sorting. Is it possible that something else comes into > effect? Josef, The problem is that sorting happens with iso639-2. (Lanugages.pm after line 255) See: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes For German (Deutsch), the code can be ger *or* deu. With ger it would be sorted as g and not as d (Deutsch). There are more languages where the code can be ambivalent, e.g. dutch, and it is not guaranteed that it is alphabetically on the same place as the native name. Maye the usage of ambivalent codes depends in Koha on what language was used during installation, that could explain that it works for you and not for me. In my opinion, the sorting should happen with the native description anyway, not with the iso 639-2 code. BTW, the native description already exists Lanugages.pm (see around line 240).