国际化的表现:RESX与数据库? [英] i18n performance: resx vs. database?

查看:117
本文介绍了国际化的表现:RESX与数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问:

我问自己,我是否应该使用.resx文件或数据库本地化我的ASP.NET MVC 3应用程序。

I'm asking myself whether I should use .resx files or a database to localize my ASP.NET MVC 3 application.

我使用一个数据库,无论如何,所以有一个数据访问层不需要任何额外的努力。

I use a database anyway, so there's no additional effort required for a data-access layer.

我知道我可以做两个,但我有点担心性能...

I know I can do both, but I'm a bit worried about performance...

这是个好主意加载DB额外的翻译工作,而这可以通过网络服务器来完成?

抑或是阅读.resx文件比使用一个数据库慢得多?

Is it a good idea loading the DB with additional translation work, whereas this could be done by the webserver ?
Or is reading the .resx files much slower than using a database ?

另外,在我看来,该的.resx文件的方式有点不灵活。

你可以假设数据库,并在同一台机器上的Web服务器运行。

您也可以假设Linux系统nginx的Web服务器为通过FastCGI的和调整PostgreSQL服务器单声道。

Also, it seems to me that the .resx-file way is a bit inflexible.
You can assume that the db and the web-server run on the same machine.
You can also assume a Linux system with nginx as webserver, mono via fastcgi and a tuned PostGreSQL server.

推荐答案

这并不需要太多的努力,创造条件,拉动资源从数据库中,并生成一个RESX文件的应用程序。从而使你维护的数据库的灵活性和易用性和RESX的性能

It doesn't take much effort to create an application which will pull the resources out of the database and generate a resx file. Thus giving you the flexibility and ease of maintenance of the database and the performance of resx.

我最近买了这种技术为我的MVC网站的工作,这里有几个LNKS我的问题关于这个问题,有些我也回答了自己的解决方案。

I recently got this technique working for My MVC website, here are a few lnks to my questions on the subject, some of which I also answered myself with the solution.

  • "Run Custom Tool" for resx files in MVC2 project (from an external application/script)
  • Do I need the resx Designer.cs file?
  • Why am I getting App_GlobalResources assembly generated? (Error = CS0433)

这篇关于国际化的表现:RESX与数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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