有人知道使用 Tornado 本地化的良好指南吗?

发布于 2024-12-20 17:24:12 字数 1539 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

最初的梦 2024-12-27 17:24:13

您可以尝试阅读 http://tornado-babel.readthedocs.org/en/latest /index.html 其中解释了本地化过程。尽管大部分内容与标准 tornado.locale 模块相关,但 tornado-babel 扩展了功能并将 babel 用于本地化和国际化。

You can try reading http://tornado-babel.readthedocs.org/en/latest/index.html where the localisation process is explained. Though most of the content is relevant for the standard tornado.locale module, tornado-babel extends the functionality and uses babel for l10n and i18n.

听闻余生 2024-12-27 17:24:13

您是否调用了 load_translations 方法?您的应用需要在 start_server 之前调用它,例如:

tornado.locale.load_translations(
    os.path.join(os.path.dirname(__file__), "translations"))

您还需要带有翻译的 CSV 文件,以正确的格式。

Did you call the load_translations method? Your app need to call that before start_server, e.g:

tornado.locale.load_translations(
    os.path.join(os.path.dirname(__file__), "translations"))

You also need CSV files with your translations, in the correct format.

咆哮 2024-12-27 17:24:13

龙卷风区域设置文档的工作链接。但在我看来,国际化进程的描述相当糟糕。

查看这篇文章,它解释了 i18n 和 i10n 流程龙卷风中的详细信息和示例。

Working link to tornado locale documentation. But to my mind the i18n process is described quite poorly there.

Check out this article, it explain the i18n and i10n processes in tornado with details and examples.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文