线程安全语言环境技术 [英] Thread safe locale techniques

查看:67
本文介绍了线程安全语言环境技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们当前正在基于线程python Web服务器框架(cherrypy)编写一个Web应用程序,并希望同时支持来自多个语言环境的用户.

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.

语言环境模块似乎不是线程安全的.是否有第3方库或模块以线程安全的方式提供语言环境解析和格式化功能?

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?

建议表示赞赏!

关于, 马尔科姆

推荐答案

pyIcu 具有某些此类功能(以及对i18n/l10n任务的其他强大支持),并且我有一段时间一直在使用它,但这与基于locale的代码的流畅移植相去甚远-您基本上必须为其重写代码.而且,它不支持不允许安装任意扩展的环境,例如App Engine和其他托管环境.不幸的是,没有这样的约束,我不知道有什么好的选择:-(.

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:-(.

这篇关于线程安全语言环境技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆