在 Web 应用程序中添加对多种语言的支持
我正在开发一个网络应用程序,该应用程序一直是英语的。我们正在努力走向国际化,并希望开始增加对其他语言的支持,目前主要是法语和西班牙语。我们将使用人工翻译,并且需要支持页面上的内容以及从数据库中提取的一些内容。
我不知道从哪里开始,所以我希望有人知道一些资源,我可以使用这些资源来帮助开始使用最佳实践、标准等。
I have a web application that I'm working on that has always been in English. We are working on going international and want to start adding support for other languages, primarily French and Spanish for now. We are going to use human translations and need to have support for both the content on the pages as well as some content being pulled from a database.
I have no idea where to start so I was hoping that someone knows of some resources that I can use to help get started with this as far as best practices, standards, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 .Net 中,您可以使用资源文件进行翻译。请参阅本教程:
http://afana.me/post/aspnet-mvc-internationalization.aspx
数据库方面略有不同,因为有许多不同的方法。有些喜欢有特定于语言的表,有些只是添加特定于语言的字段(即 c_title、c_title_fr、c_title_es...)。我曾经开发过一个 Java 应用程序,它有一个名为 LocalizedDescriptionItem 的类,每个需要本地化的对象都会继承该类。每条记录都有一个语言键字段,并带有指向绑定表的外键,以将每个项目链接到默认(英语)版本。这样,每个翻译都有自己的记录,并且可以在需要时单独提取。
In .Net you can use resource files for the translations. See this tutorial:
http://afana.me/post/aspnet-mvc-internationalization.aspx
The database side is a little different in that there are a number of different approaches. Some like to have language specific tables, some just add language specific fields (ie. c_title, c_title_fr, c_title_es...). I developed a Java application once that had a class called LocalizableDescriptionItem, which was inherited by every object that required localization. There was a language key field for each record with a foreign key to a binding table to link each item to the default (English) version. This way, each translation had it's own record and could be pulled separately if needed.