多语言语音支持windows格式的文本框c#? [英] Multi language phonetics support for textboxes in windows form c#?

查看:68
本文介绍了多语言语音支持windows格式的文本框c#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何填写下拉列表包含世界上所有语言的语言名称和

当我在下拉列表中选择乌尔都语时,我的textbox1语言自动开始在urdu中写入或当我选择英语时,文本框支持英语

当我选择印地文文本框只支持印地文或当我从下拉列表中选择法语时我的文本框仅自动支持法语语言





问题?如何管理哪个工具最适合支持?



 List< string> lan =  new  List< string>(); 
CultureInfo [] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);

foreach var culture 文化中)
{

if ((culture.CultureTypes& CultureTypes.UserCustomCulture)== CultureTypes。 UserCustomCulture)
继续;


if (culture.TwoLetterISOLanguageName.Length == 2
继续;

lan.Add(culture.EnglishName);
}
radDropDownList3.DataSource = lan;





无法解决我的问题因为没有提供完整的语言包列表,如URDU,ENGLISH,ARABIC,HINDI缺少

解决方案

没有这样的工具。



系统不会开始将键盘转换为适当的语言您。它也不会开始为您在语言之间转换文本。



您的代码必须提供资源文件来表示应用程序使用的字符串,例如文本标签和其他控件,由您翻译。每个资源文件都会保存您用于特定语言的字符串。



开始阅读这些 [ ^ ]了解更多信息关于本地化和全球化。


首先,您的概念设备可能已损坏,或者您的术语可能太多了。但是,我可以看到许多迹象表明真正的问题比术语更糟糕。首先,让我们解雇语音学。输入文本与语音无关,它是文本。也许你已经阅读了一下,了解什么是语音,它是关于语音,而不是你输入的字符;人类言语的这些方面之间存在很大距离:语音 - 维基百科,免费的百科全书 [ ^ ]。



现在,关于文化和语言。 这不是文本框或任何其他控件的业务。这是整个应用程序(正式地)部分或全部应用程序线程的责任。 (请参阅 System.Threading.Thread https://msdn.microsoft.com/en-us/library/system.threading.thread.currentculture(v = vs.110)的.aspx [ ^ ], https:/ /msdn.microsoft.com/en-us/library/system.threading.thread.currentuiculture(v=vs.110).aspx [ ^ ]。)我不想进一步讨论这里的文化,请参阅解决方案1;问题更深。



说到开始用乌尔都语写英文......等等,问题在于对计算文化的一般理解,这种情况下,用户,操作系统和应用程序之间的关系。当涉及到文本框时,没有任何开始用乌尔都语写作(或任何其他语言),但用户。这是输入一些字符的用法。什么都不应该自动切换。用户应该能够在任何给定的时刻输入任何语言的字符。如果应用程序的状态不能除了某些字符,则可能是验证问题,在最坏的情况下 - 过滤。如果你想学习如何过滤掉一些角色,我可以帮助你(或者你可以自己弄清楚如何做到这一点),但这不是你真正的问题。你的问题是理解。什么是当前的输入语言不应该由应用程序决定。它应由用户决定,并且仅由用户决定。这是通过选择一种或另一种输入方法和输入语言来完成的,这是通过OS工具完成的,例如Windows任务栏上的语言控制元素。您可以通过开发和安装自己的布局来特别贡献可用的布局。怎么做?我在过去的回答中解释过:输入印地语和英语的问题 [ ^ ]。



重要提示:它允许用户在一个字符串中输入不同语言的片段。但这就是现代计算文化的运作方式。在几乎所有现代操作系统中,所有文本都基于Unicode。不基于Unicode的稀有应用程序要么已过时,要么解决语言严重不相关(并且仍然过时)的应用程序问题。 .NET字符串是Unicode字符串,没有别的。对于某些非字符串的对象(如流),仍然会略微支持非Unicode编码。 重要的一点是:输入法/语言选择应该与应用程序分开。



-SA

how to fill dropdownlist contain language name of all languages in world and
When i select Urdu in drop downlist my textbox1 language automatically start writing in urdu or When i select 'English' text boxes support english
when i select hindi textboxes support only hindi or when i select french from dropdown list my textboxes automatically support french lanuage only


problem? How to manage this which tool is best supported for that ?

List<string> lan = new List<string>();
          CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);

          foreach (var culture in cultures)
          {

              if ((culture.CultureTypes & CultureTypes.UserCustomCulture) ==   CultureTypes.UserCustomCulture)
                  continue;


              if (culture.TwoLetterISOLanguageName.Length == 2)
                  continue;

           lan.Add (culture.EnglishName  );
          }
          radDropDownList3.DataSource = lan ;



not solve my problem because not giving complete list of language pack like URDU , ENGLISH , ARABIC , HINDI missing

解决方案

There is no such tool.

The system will not start converting a keyboard into an appropriate language for you. It will also not start converting text between languages for you either.

Your code has to provide the resource files to represent the strings your application uses, such as the text in Labels and other controls, translated by YOU. Each resource file will hold the string your use for one particular language.

Start reading these[^] for more information on Localization and Globalization.


First of all, you notion apparatus is probably broken, or perhaps your terminology is too much off. However, I can see many signs that the real problem is worse than just terminology. First, let's dismiss "phonetics". Entering texts has nothing to do with phonetics, it's text. Perhaps you have read a bit to understand what is phonetics, it's about sounds of speech, not characters you enter; there is a big distance between these aspects of human speech: Phonetics - Wikipedia, the free encyclopedia[^].

Now, about cultures and languages. This is not the business of text boxes or any other controls. This is the responsibility of the whole application, formally, of some or all of the application threads. (Please see the documentation on System.Threading.Thread, https://msdn.microsoft.com/en-us/library/system.threading.thread.currentculture(v=vs.110).aspx[^], https://msdn.microsoft.com/en-us/library/system.threading.thread.currentuiculture(v=vs.110).aspx[^].) I don't want to further discuss cultures here, please see Solution 1; the problem is even deeper.

When it comes to "start writing in Urdu… English", and so on, the problem is the general understanding of computing culture, in this case, relationships between the user, OS and an application. When it comes to a text box, nothing "starts writing in Urdu" (or any other language) but the user. This is the use who has enter some characters. Nothing should be automatically switched. The user should be able to enter characters of any language at any given moment of time. If the status of application cannot except some characters, it could be a matter of validation, in worst case — filtering. If you want to learn how to filter out some characters, I can help you (or you can figure out how to do it all by yourself), but this is not your real problem. Your problem is understanding. What is the current input language should not be decided by the application. It should be decided by the user and only by the user. This is done via choosing one or another input method and input language, which is done via the OS tool, such as the language control element on the Windows taskbar. You can contribute, in particular, to available layouts, by developing and installing your own. How to do that? I explained it in my past answer: Problem in typing in Hindi and english[^].

Important note: it allows the user to enter fragments in different languages in a single string. But this how modern computing culture works. In nearly all modern OS, all texts are based on Unicode. Rare applications not based on Unicode are either obsolete or solve application problems where the languages are majorly irrelevant (and are still obsolete). .NET strings are Unicode strings and nothing else. Non-Unicode encodings are still marginally supported, for some objects which are not strings, such as streams. Important point here is: the input method/language choice should be separated from the application.

—SA


这篇关于多语言语音支持windows格式的文本框c#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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