Reputation: 2085
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.
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?
What about adding SupportedCultures
in the .csproj
file. Anything of that kind here?
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
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
Reputation: 16361
Yes it is, if you localize in XAML the you must use x:Uid instead of bindings
There is no need, supported laguages are detected automatically from your resource files
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