mvc中的文化问题 [英] culture problem in mvc

查看:66
本文介绍了mvc中的文化问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个单选按钮和一个文本框。一个单选按钮用于英语,第二个用于阿拉伯语。现在我点击阿拉伯语单选按钮将我当前的文化更改为阿拉伯语并显示文本框的阿拉伯语错误消息。我为英语和阿拉伯语创建了2个resx文件。现在,当我点击MVC 4剃须刀应用程序中的第二个单选按钮时如何改变文化。

解决方案

如果你一次使用多种语言,如果意味着文化和UI UI线程的文化应该是相同的。只是不要改变它,保持默认。你不需要任何特定的文化来写英文和阿拉伯文。简单来说,就是忘记文化。



(文化只规定表示货币,时间/日期,小数,将字符串解析为这些数据类型的默认方式等等这与你在按钮上写文字的方式无关。即使你需要为上述操作使用不同的文化,你也可以将文化作为所有这些功能的参数传递。但是对于在按钮上写文本,你甚至不需要。默认文化以及中性文化就足够了。)



-SA

i have two radio buttons and one text box . one radio button for English and second one for Arabic. now i click on Arabic radio button my current culture change into Arabic and displays arabic Error message for a text box. i created 2 resx files for english and arabic. now how to change culture when i click on 2nd radio button in MVC 4 razor application.

解决方案

If you use several languages at once, if means that the culture and UI culture of your UI thread should be the same. Just don't change it, leave it to default. You don't really need any specific culture just to write English and Arabic text. In simple words, simply forget about cultures.

(Cultures only dictate the default ways to represent currency, time/date, decimal, parsing string into these data types, etc. This is all irrelevant to how you write text on a button. Even if you need to use different cultures for the operations mentioned above, you can pass the culture as a parameter of all such function. But for writing a text on a button, you don't need even that. Default culture, as well as neutral culture, would be good enough.)

—SA


这篇关于mvc中的文化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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