I want to sort list of strings with respect to user language preference. I have a multilanguage Python webapp and what is the correct way to sort strings such way?
I know I can set up locale, like this:
import locale
locale.setlocale(locale.LC_ALL, '')
But this should be done on application start (and doc says it is not thread-safe!), is it good idea to set it up in every thread according to current user (request) setting?
I would like something like function locale.strcoll(...) with additional parameter - language that is used for sorting.