如何走向国际化?
我正在构建一个 Web 应用程序,该应用程序在启动时将采用单一语言(荷兰语)。然而,在某些时候它也可能被翻译成其他语言,这就是为什么我想从一开始就内置国际化。
问题是目前有 3 个独立的地方显示字符串,即模板、python 后端和一些 javascript。由于我从未将任何类型的应用程序国际化,所以我想知道是否有某种方法可以避免这种传播?另外,实现国际化的最佳方式是什么?
编辑:作为一点澄清,我使用以下部分:Jinja2、Flask、WTForms jQuery,以及一堆 Python 和 Javascript 代码。
I'm building a web application that will be in a single language (Dutch) at launch. However, at some point it might be translated to other languages as well, which is why I want to have internationalization build in from the start.
The problem is that currently there are 3 separate places that display strings, namely the templates, the python backend and some javascript. Since I've never internationalized an application of any kind I was wondering if there is some way of avoiding this spread? And also, what is the best way to go about internationalization?
Edit: As a bit of clarification, I'm using the following parts: Jinja2, Flask, WTForms jQuery, and on top of that a bunch of Python and Javascript code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知, gettext 是 i18n 使用最广泛的工具。但是,每种语言和框架都围绕此实现了自己的包装器:
gettext 插件所有这些都应该使用相同的翻译文件,因此它们应该能够一起工作,而不会出现任何重复的翻译。
As far as I know, gettext is the most widely used tool for i18n. However, every language and framework implements it's own wrappers around this:
gettext pluginAll of them should use the same translation files, so they should be able work together without any duplication in the translations.