C#Windows应用程序中的多种语言 [英] Multiple language in a C# windows application
本文介绍了C#Windows应用程序中的多种语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在做一个Windows应用程序来进行满意度调查.要求是,我需要用英语和阿拉伯语提问.我已经用英语完成了,很好..现在如果他们想用阿拉伯语进行调查,那么他们应该可以选择.
我真的不知道如何在项目中包含2种语言.
I am doing a windows application for satisfaction survey.The requirement is that ,I need the questions in English and Arabic language. I have done in English language,its wrkng fine..Now If they want to give the survey in Arabic language,then they should have the option for it.
Really I dont know how to include 2 languages in a project.
Please help me!!!!
推荐答案
Fsted jst通过此链接将为您提供帮助.它适用于网站,但从资源文件获取值的过程将保持不变. :::
创建多语言网站-第1部分 [
Frined jst go through this link it will help you.Its for website but the process for getting values from resource file will remain same:::
Creating multilingual websites - Part 1[^]
You have make changes in your application .
You need to put all string values in resource files.And have to create two diffrent resource files for each language.
And on page_load you can set the string values from the slected language Resource file for each page.
阅读以下内容:
使用C#在20分钟内全球化Windows应用程序 [ http://msdn.microsoft.com/en-us/library/b28bx3bh%28v = vs.80%29.aspx [ ^ ]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=174 [ ^ ]
http://www.codeproject.com/KB/locale/ [
Read the following :
Globalization of Windows Applications in 20 Minutes Using C#[^]
http://msdn.microsoft.com/en-us/library/b28bx3bh%28v=vs.80%29.aspx[^]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=174[^]
http://www.codeproject.com/KB/locale/[^]
您是如何用英语制作该应用程序的?您是否对所有控制文本进行了硬编码?
我建议您创建2个XML文件,其中1个用于英语,另一个1个用于阿拉伯语,如下所示:
How did you make the application with English language? Did you hard code all the control texts?
I suggest you create 2 XML files, 1 for the English language and another 1 for the Arabic language that would look something like this:
<captions>
<form1 controlid="btnCancel" text="Cancel" />
<form1 controlid="btnOK" text="OK" />
</captions>
这将需要您制作另一个类来读取XML文件,并使用它来加载控件的文本.
希望这可以帮助. :)
This will need you to make another class to read the XML file and use it to load the controls'' texts though.
Hope this helps. :)
这篇关于C#Windows应用程序中的多种语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文