本地化,如何使用特定的resx [英] Localization, how to use a specific resx

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

问题描述

今天我在玩本地化.我有一个winforms应用程序,在其中将屏幕上的localizable可设置为true,然后我将所有文本尽可能地转换为西班牙语.所以现在我有了我的screen.resx和我的screen.es.resx,一切看起来都很好/布宜诺斯艾利斯.现在如何运行我的应用程序,并显示西班牙语版本?我尝试进入区域和语言选项,并将标准和格式"选项设置为西班牙语.现在我的日期是西班牙语,这很好,但是我的应用程序上的文本仍然是英语.如何在我的screen.es.resx中加载此东西?

Today I'm playing with localization. I have a winforms app where I've set localizable to true on my screen, then I went and converted all the text to spanish as best as I could. So now I have my screen.resx and my screen.es.resx and everything looks good/bueno. How do I now run my app and have the spanish version come up? I tried going into regional and language options and setting my 'standards and formats' option to spanish. Now my dates are in spanish which is good, but the text on my app is still the english version. How do I get this thing to load with my screen.es.resx?

推荐答案

您是否将应用程序Culture/UI Culture设置为西班牙语?在下面的代码中,en-US将被您的UI文化取代,并将根据您的设置方式使用适当的resx文件

Did you set your applications Culture/UI Culture to Spanish? In following code, en-US will be replaced by your UI culture and it will use appropriate resx file depending on the way you have them set up

HTH

System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("en-US", false);
System.Threading.Thread.CurrentThread.CurrentUICulture = myCI;
System.Threading.Thread.CurrentThread.CurrentCulture = myCI;

这篇关于本地化,如何使用特定的resx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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