alfah
alfah

Reputation: 2085

How to localize a Win 8 metro app

I'm porting my Windows Phone App to Windows 8 and localizing to support several languages as per MSDN. I just want to clarify a few things before I start with the localization.

  1. While localizing for Windows Phone, I had writtern a separate class called LocalizedStrings and used a ResourceManager to fetch the strings in the code behind and for XAML I used bindings. The MSDN link shows the use of x:Uid for each element and this works fine for English. I would like to confirm whether this is the right approach?

  2. What about adding SupportedCultures in the .csproj file. Anything of that kind here?

  3. Is there a way to test the different languages in the Simulator? How can I change the language settings in simulator?

Would be really grateful if someone could clarify these.

Upvotes: 0

Views: 662

Answers (2)

Bart
Bart

Reputation: 10015

Since Igor answered your 3 questions already and XAML binding is the way to go, I'm not gonna repeat those answers.

However, I'd like to add that you have to plan whether you're defining the resources in the same assembly, or offloading them to another assembly. Because binding to the offloaded resources is a bit trickier, you'll have to define your x:Uid similar to:

<TextBlock x:Uid="/OffloadingResources.Resources/Resources/AppTitle" .. />

Upvotes: 1

Igor Kulman
Igor Kulman

Reputation: 16361

  1. Yes it is, if you localize in XAML the you must use x:Uid instead of bindings

  2. There is no need, supported laguages are detected automatically from your resource files

  3. The language settings in the Simulator are the same as in your system. You should add all the languages to your system (Control Panel\Clock, Language, and Region\Language) and then change their priority to see different localization in your application

Upvotes: 1

Related Questions