[Bug 20160] New: Sort translated languages by code
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 Bug ID: 20160 Summary: Sort translated languages by code Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: pasi.kallinen@joensuu.fi QA Contact: testopia@bugs.koha-community.org The language tabs in Change notices -page are in random order, and will rearrange at every page reload. This is quite irritating. Make getTranslatedLanguages return the languages always in the same order, sorted by the language code. This is better than returning them in a random one. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 paxed <pasi.kallinen@joensuu.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |pasi.kallinen@joensuu.fi |ity.org | --- Comment #1 from paxed <pasi.kallinen@joensuu.fi> --- Created attachment 71333 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71333&action=edit Bug 20160: Sort translated languages by code The language tabs in Change notices -page are in random order, and will rearrange at every page reload. This is quite irritating. Make getTranslatedLanguages return the languages always in the same order, sorted by the language code. This is better than returning them in a random one. Test plan: 1) Enable TranslateNotices 2) Install multiple languages 3) Go to Home -> Tools -> Notices & slips 4) Edit any notice 5) Reload the page multiple times. The language tabs will rearrange at random 6) Apply patch 7) Repeat 1-5. The language tabs should now always be in the same order, sorted by the language code. Do the same test to Home -> Tools -> News -> Add News item (Check the "Display location" dropdown) Check Home -> Patrons -> Add patron (the "Preferred language for notices" dropdown) Check Home -> Administration -> System preferences -> i18n/l10n (Note the order of languages listed for "language" and "opaclanguages") Check Home -> Administration -> System preferences -> Local use (Create a new preference with variable type Languages, check the language pref listed in the table) Check Home -> Administration -> Item types -> Add item type (After the Description-field, there's "Translate into other languages", click on that. In the pop-up that opens, check the language drop-down) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |mtompset@hotmail.com --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- This sort doesn't quite sort. Install multiple regional English languages, and see if it is the order you would expect. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 --- Comment #3 from paxed <pasi.kallinen@joensuu.fi> --- (In reply to M. Tompsett from comment #2)
This sort doesn't quite sort. Install multiple regional English languages, and see if it is the order you would expect.
Good point, didn't think to test that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 paxed <pasi.kallinen@joensuu.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71333|0 |1 is obsolete| | --- Comment #4 from paxed <pasi.kallinen@joensuu.fi> --- Created attachment 71596 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71596&action=edit Bug 20160: Sort translated languages by code The language tabs in Change notices -page are in random order, and will rearrange at every page reload. This is quite irritating. Make getTranslatedLanguages return the languages always in the same order, sorted by the language code. This is better than returning them in a random one. Test plan: 1) Enable TranslateNotices 2) Install multiple languages, including multiple regional English languages 3) Go to Home -> Tools -> Notices & slips 4) Edit any notice 5) Reload the page multiple times. The language tabs will rearrange at random 6) Apply patch 7) Repeat 1-5. The language tabs should now always be in the same order, sorted by the language code. Do the same test to Home -> Tools -> News -> Add News item (Check the "Display location" dropdown) Check Home -> Patrons -> Add patron (the "Preferred language for notices" dropdown) Check Home -> Administration -> System preferences -> i18n/l10n (Note the order of languages listed for "language" and "opaclanguages") Check Home -> Administration -> System preferences -> Local use (Create a new preference with variable type Languages, check the language pref listed in the table) Check Home -> Administration -> Item types -> Add item type (After the Description-field, there's "Translate into other languages", click on that. In the pop-up that opens, check the language drop-down) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 paxed <pasi.kallinen@joensuu.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20193 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20193 [Bug 20193] Path to Greybox CSS broken after Bug 12904 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71596|0 |1 is obsolete| | --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 71622 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71622&action=edit Bug 20160: Sort translated languages by code The language tabs in Change notices -page are in random order, and will rearrange at every page reload. This is quite irritating. Make getTranslatedLanguages return the languages always in the same order, sorted by the language code. This is better than returning them in a random one. Test plan: 1) Enable TranslateNotices 2) Install multiple languages, including multiple regional English languages 3) Go to Home -> Tools -> Notices & slips 4) Edit any notice 5) Reload the page multiple times. The language tabs will rearrange at random 6) Apply patch 7) Repeat 1-5. The language tabs should now always be in the same order, sorted by the language code. Do the same test to Home -> Tools -> News -> Add News item (Check the "Display location" dropdown) Check Home -> Patrons -> Add patron (the "Preferred language for notices" dropdown) Check Home -> Administration -> System preferences -> i18n/l10n (Note the order of languages listed for "language" and "opaclanguages") Check Home -> Administration -> System preferences -> Local use (Create a new preference with variable type Languages, check the language pref listed in the table) Check Home -> Administration -> Item types -> Add item type (After the Description-field, there's "Translate into other languages", click on that. In the pop-up that opens, check the language drop-down) Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |julian.maurice@biblibre.com --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- Patch works but there is no test. Please write some. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 --- Comment #7 from paxed <pasi.kallinen@joensuu.fi> --- (In reply to Julian Maurice from comment #6)
Patch works but there is no test. Please write some.
I have no idea how I would go writing test for this, because getTranslatedLanguages wants the translated theme directories present. Someone else will have to take this. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- I think you can mock _get_language_dirs with Test::MockModule to make it return whatever is needed for the tests. Have a look at t/lib/Mocks.pm for examples of usage. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hum, did you see bug 20115? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20160 paxed <pasi.kallinen@joensuu.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |RESOLVED Resolution|--- |INVALID --- Comment #10 from paxed <pasi.kallinen@joensuu.fi> --- Was fixed by bug 20115 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org