如何用另一种语言翻译网站?(ASP .NET,C#) [英] How to translate website in another language?(ASP .NET , c#)

查看:187
本文介绍了如何用另一种语言翻译网站?(ASP .NET,C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我公司开发的大型商业门户网站。我才意识到我需要我的网站在另一种语言。我已经研究了解决方案,可像

  • 使用我网站上的第三方控制。 (有没有适合我的设计。不是有用的关于搜索引擎优化的角度,不要想显示第三方的品牌。)

  • 为每种语言创建资源文件。(重组页使用的文本来自资源文件需要大量的工作。什么由像业务描述用户输入的数据。)

  • I have developed a large business portal. I just realized I need my website in another language. I have researched the solutions available like

  • Used third party control on my website. (Does fit in my design. Not useful regarding SEO point of view. Dont want to show third party brand names.)
  • Create Resource files for each language.( A lot of work required to restructure pages to use text from resource files. What about the data entered by the user like Business Description. )
  • 是否有任何可用的其他选项。
     

    当服务器端创建一个页面,然后我可以发送回客户端之前翻译它,我想就像一个一个的解决方案。有没有什么办法可以做到这一点?(一切包括数据库或通过code,而且不影响设计增加了数据转换。)

    Are there any Other options available.
    I was thinking of a solution like a when a page is created on server side then I could translate it before sending back to client. Is there any way I can do that?(to translate everything including data added from databases or through a code. And without effecting design. )

    推荐答案

    如果你真的需要翻译你的应用程序,它会采取了很多的艰辛,繁琐的工作。 有没有灵丹妙药。

    If you really need to translate your application, it's going to take a lot of hard, tedious work. There is no magic bullet.

    您需要做的第一件事是转换你的纯文本在您的标记ASP:本地化控制。通过使用本地化控制,你可以离开你现有的<跨度> 标记的地方,只需更换其中内的文本。还有的实在没有办法解决这个。 Visual Studio的查找和替换支持正前pression匹配,可以帮助您这个问题,或者您可以使用ReSharper的(见下文)。

    The first thing you need to do is convert your plain text in your markup to asp:Localize controls. By using the Localize control, you can leave your existing <span> tags in place and just replace the text inside of them. There's really no way around this. Visual Studio's search and replace supports regular expression matching that may help you with this, or you can use Resharper (see below).

    第一种方法是下载开放源代码的购物应用程序 nopCommerce ,看看他们如何处理自己的定位。它们存储他们的字符串在数据库中,有编辑语言的UI。类似的方法可以很好地帮助你。

    The first approach would be to download the open source shopping application nopCommerce and see how they handle their localization. They store their strings in a database and have a UI for editing languages. A similar approach may work well for you.

    另外,如果你想使用资源文件,有两个工具,我会建议使用除了Visual Studio中:的 ReSharper的5 (<一个href=\"http://hadihariri.com/blogengine/post/2010/02/16/Localizing-your-Applications-with-ReSharper-5.aspx\">Localization特点抓屏)和泽塔资源编辑器。这些都是我想借此用这个方法来完成它的步骤:

    Alternatively, if you want to use Resource Files, there are two tools that I would recommend using in addition to Visual Studio: Resharper 5 (Localization Features screencast) and Zeta Resource Editor. These are the steps I would take to accomplish it using this method:


    1. 使用Visual Studio中的生成本地资源工具,每一页

    2. 使用ReSharper的的移动HTML资源上的文字在您的标记,以使它们成为本地化的控制。

    3. 使用ReSharper的搜索出任何本地化字符串在你的背后code,并将其移动到资源文件中。

    4. 使用code分析/ FxCop的全球化规则,以帮助找到你可能面临格式化数字,日期等任何额外的问题。

    5. 一旦所有的文字是在RESX文件,请使用泽塔资源编辑器加载了所有的RESX文件,添加新的语言,和出口翻译(或自动翻译,如果你有足够的勇气)。

    我已经用在翻译成8种语言(和增长)网站与几十页而且还在不断增长这一做法。然而,这不是一个用户可编辑的位点;页面是由程序员完全控制。

    I've used this approach on a site translated into 8 languages (and growing) with dozens of pages (and growing). However, this is not a user-editable site; the pages are solely controlled by the programmers.

    这篇关于如何用另一种语言翻译网站?(ASP .NET,C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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