开发者

WP7 Localization issues from C#

开发者 https://www.devze.com 2023-04-05 22:24 出处:网络
I\'m having an issue with the localization in my converters. So, I tried a new project and still have problems.

I'm having an issue with the localization in my converters. So, I tried a new project and still have problems.

So, I created a fresh new Silverlight for Windows Phone application (7.0,开发者_如何学Python but 7.1 don't resolve my problem).

I added two resources files: Strings.resx and Strings.fr.resx. This two files have two string property: HelloString and ByeString, all initiated correctly.

Then, I go to the Mainpage.xaml.cs, in the ctor and add the following simple line.

PageTitle.Text = Strings.HelloString; 

Whenever I have the emulator or my phone set to English or French, I always got the same strings (Hello).

I tried to rename the file Strings.fr-FR.resx. Still the same issue. The CurrentUICulture returned from the current thread is correct. I also tried to force culture on the resource:

Strings.Culture = new System.Globalization.CultureInfo("fr-FR"); 

Does anyone have an idea?


You don't say that you've set the SupportedCultures for the project. Without this the additional language resource files will never be used.

See http://msdn.microsoft.com/en-us/library/dd941931(v=vs.95).aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号