如何在网站中以不同语言翻译文本 [英] How to translate text in site in different languages

查看:58
本文介绍了如何在网站中以不同语言翻译文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用C#在asp.net中创建了一个网站.

在网站上,我们必须使用显示语言列表的页面顶部的下拉菜单.

当我们选择语言时,网站应该会转换成该语言.

示例:如果假设我在下拉列表中选择了法语,则站点中使用的文本应转换为法语,包括gridview项等.

请有人帮助我.

I have created a web site in asp.net with C#.

In site we have to use a drop down on top the page in which list of languages are present.

When we select language the site should get convert into that language.

Example : If Suppose I select french in the dropdown the text used in site should get convert into french including the gridview items etc.

Please some body help me.

推荐答案

CodeProject存档以进行救援.
我认为这就是您要寻找的内容: ASP.NET 2.0中神秘化的全球化和本地化 [ ^ ]
CodeProject archive for rescue.
I think this is what you are looking for: Globalization and localization demystified in ASP.NET 2.0[^]


Sandeep的答案是一个很好的答案,但您应该自己进行自定义(我的意思是您需要在末尾进行更多的编码).无论如何,这将对您有帮助.

创建多语言网站-第1部分 [创建多语言网站-第2部分 [创建多语言网站-第3部分 [
Sandeep''s answer is good one but you should do the customization yourself(I mean you need to do more coding at your end). Anyway This will help you.

Creating multilingual websites - Part 1[^]

Creating multilingual websites - Part 2[^]

Creating Multilingual Websites - Part 3[^]




您可以使用资源文件来将静态文本转换为目标语言.

由于用户键入任何控件(如文本框等)的数据将是需要转换的动态数据,因此您可以使用Google转换器执行相同的操作.

请参阅以下文章.

http://www.codeproject.com/KB/cs/translateresx.aspx?msg= 3681305#xx3681305xx [ ^ ]

我最近在同一篇文章中添加了一篇文章,以获取翻译后的文字值.您可以从上面的帖子中下载代码,然后根据我的答案修改代码.

希望这能回答您的问题
Hi,

You can use the resource files to get the static text converted into the destination language.

Where as the data that user key into the any controls (like textbox etc) will be a dynamic data that needs to be converted as well, you can use the google translator to do the same.

Refer the following article.

http://www.codeproject.com/KB/cs/translateresx.aspx?msg=3681305#xx3681305xx[^]

I have recently added a post to the same to get the translated text value. you can download the code from the above post and then just modify the code as per my answer.

Hope this will answer your question


这篇关于如何在网站中以不同语言翻译文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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