https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36947

David Cook <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #83 from David Cook <[email protected]> ---
(In reply to Jonathan Druart from comment #81)
> Are you sure using Sort::Naturally is not enough? At least the tests pass.
> If it's not enough please provide a test that makes this last patch fail.

Yes, I am reasonably sure that Sort::Naturally is not enough. If you read
through the comments, you'll see that I've previously indicated that the tests
are flawed in the current koha-testing-docker because of the available locales.
This could be fixed, but would take some coordination with whoever manages the
ktd images. I'm guessing Tomas?

I'll explain in a bit more detail below.

--

Unicode::Collate::Locale is core Perl. Sort::Naturally is a CPAN module which
isn't currently available in Koha. 

Sort::Naturally appears to just use "use locale" under the hood. If you look
back on the comments, you can see that has already been explored. Maybe I
wasn't clear in past comments abouts its limitations, but from memory it's
limited to the system locale or the locale as specified in the runtime
environment of that process at startup (I can't recall if it's compile time or
run time though). Unicode::Collate::Locale allows us to very easily work with
locales supplied at runtime, which creates many wonderful possibilities for
adapting to the language needs of users. Due to limited resources, Martin has
specified the locale via a system preference, but there's really a lot more
potential here, if you're interested in this topic.

Finally, the unit tests are constrained by the locales available on
koha-testing-docker. If you run `locale -a`, you'll see the following:

C
C.utf8
en_US.utf8
fr_FR.utf8
POSIX

All of these locales use the same underlying Unicode collator, so they're all
always going to have the same result. 

In order for Martin or myself to "provide a test that makes this last patch
fail", we'd have to change the koha-testing-docker to include a locale like
fi_FI which has a different Unicode collator. 

Now I think it would be a great idea to add fi_FI to koha-testing-docker for
this purpose alone. I think we haven't done that because of the obstacle that
presents, but yeah... that's an option. Probably a good one in fact. 

I'm adding Tomas as CC. I'll send him a message on Mattermost too. If we can
get a new KTD image with fi_FI as an available locale, then we can write a test
to prove how good Unicode::Collate::Locale is and why we need it.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to