We’re currently writing a web application based on a threaded python web server framework (cherrypy) and would like to simultaneously support users from multiple locales.
The locale module doesn’t appear to be thread safe. Are there 3rd party libraries or modules that provide locale parsing and formatting functionality in a thread-safe way?
Suggestions appreciated!
Regards,
Malcolm
pyIcu has some such functionality (and other great support for i18n/l10n tasks), and I’ve been using it some of the time, but it’s far from a smooth port of
locale-based code — you’ll basically have to rewrite your code for it. Also, it doesn’t support environments where you’re not allowed to install arbitrary extensions, such as App Engine and some other hosted environments. Unfortunately I don’t know of a good alternative without such constraints:-(.