你如何定位数据库驱动的网站 [英] How do you localize a database driven website

查看:147
本文介绍了你如何定位数据库驱动的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在玩内置定位功能的.NET,他们似乎都依赖于将数据的resx文件。

I've been playing with the .NET built in localization features and they seem to all rely on putting data in resx files.

但大多数系统不能依靠这一点,因为他们是数据库驱动。那么,你如何解决这个问题?是否有一个内置的.NET的方式,还是你创建SQL中的翻译表,手工做这一切?如果你必须这样做对大多数的网站,没有任何理由,甚至使用本地化的RESX方式?

But most systems can't rely on this because they are database driven. So how do you solve this issue? Is there a built in .NET way, or do you create a translations table in SQL and do it all manually? And if you have to do this on the majority of your sites, is there any reason to even use the resx way of localization?

这方面的一个例子是我有我的网站上的常见问题列表中,我把这个列表中的数据库,这样我可以轻松地添加/移除较多,但通过将其在数据库中,我也没有什么好办法必须把这种信息成多种语言。

An example of this is I have an FAQ list on my site, I keep this list in the database so I can easily add/remove more, but by putting it in the database, I have no good way have translating this information into multiple languages.

推荐答案

在我看来,本地化动态内容(例如,您FAQ)应由您在数据库中进行。根据您的问题进行存储,我可能会创建一个区域栏,并选择使用从数据库中常见的问题时。我不知道这是否会扩展得非常好,当你开始大量本地化的表。

In my opinion, localizing dynamic content (e.g., your FAQ) should be done by you in your database. Depending on how your questions are stored, I would probably create a "locale" column and use that when selecting the FAQ questions from the database. I'm not sure if this would scale very well when you started localizing lots of tables.

对于静态的内容(例如,表单字段标签,静态文本,图标等),你应该使用基于文件的资源可能会就好了。如果你真的想,但是,它看起来像它不会超硬创建一个自定义的资源提供者的实现,可以处理这个问题。

For static content (e.g, form field labels, static text, icons, etc) you should probably be just fine using file-based resources. If you really wanted to, however, it looks like it wouldn't be super hard to create a custom resource provider implementation that could handle this.

下面是一些相关链接:

  • <一个href="http://channel9.msdn.com/forums/Coffeehouse/250892-Localizing-with-a-database-or-resx-files/">http://channel9.msdn.com/forums/Coffeehouse/250892-Localizing-with-a-database-or-resx-files/
  • <一个href="http://weblogs.asp.net/scottgu/archive/2006/05/30/ASP.NET-2.0-Localization-_2800_Video_2C00_-Whitepaper_2C00_-and-Database-Provider-Support_2900_.aspx">http://weblogs.asp.net/scottgu/archive/2006/05/30/ASP.NET-2.0-Localization-_2800_Video_2C00_-Whitepaper_2C00_-and-Database-Provider-Support_2900_.aspx
  • <一个href="http://www.arcencus.nl/Blogs/tabid/105/EntryID/20/Default.aspx">http://www.arcencus.nl/Blogs/tabid/105/EntryID/20/Default.aspx
  • <一个href="http://msdn.microsoft.com/en-us/library/aa905797.aspx">http://msdn.microsoft.com/en-us/library/aa905797.aspx
  • <一个href="http://www.$c$cproject.com/KB/aspnet/customsqlserverprovider.aspx">http://www.$c$cproject.com/KB/aspnet/customsqlserverprovider.aspx
  • http://channel9.msdn.com/forums/Coffeehouse/250892-Localizing-with-a-database-or-resx-files/
  • http://weblogs.asp.net/scottgu/archive/2006/05/30/ASP.NET-2.0-Localization-_2800_Video_2C00_-Whitepaper_2C00_-and-Database-Provider-Support_2900_.aspx
  • http://www.arcencus.nl/Blogs/tabid/105/EntryID/20/Default.aspx
  • http://msdn.microsoft.com/en-us/library/aa905797.aspx
  • http://www.codeproject.com/KB/aspnet/customsqlserverprovider.aspx

这篇关于你如何定位数据库驱动的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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