3

I created a few resource files for different languages. (E.g. resource.resx, resource.nl-NL.resx etc)

At this moment I only can see the result with the phone emulator. (By changing the language setting in the phone emulator)

For the design phase I want to see the result in different languages at design time. For example Dutch. (Or even better, some pseudo language)

It looks like Visual Studio (2012) and Blend both use the default resource file. (resource.resx)

Is there a way to use another resource file?

Tim
  • 939
  • 1
  • 7
  • 13

2 Answers2

0

I could not find a good solution for this, so I did a very ugly thing. Works but is no fun at all.

I renamed the resource files so that the language I wanted to see had no language suffix (and the original one had a suffix that I know I will not use).

Some caveats:

  • The original language-neutral resource file has a 'custom tool' property of 'PublicResXFileCodeGenerator' (or equivalent). The resource file that is the new neutral language needs this property. It must be removed later on when we go back to the original situation after testing.
  • If the language that you want to test did not redefine all strings, you may get some compile-time errors and you need to copy the missing strings from the original neutral resource file.

The only advantage is that there is no need to reboot the emulator to see this language in action.

Timores
  • 14,439
  • 3
  • 46
  • 46
-1

You can set the CultureInfo property by inserting the following code into the InitializePhoneApplication inside app.xaml.cs

private void InitializePhoneApplication()
{
    Thread.CurrentThread.CurrentCulture = new CultureInfo("da-DK");
    Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

This will override the culture, so you don't have to change it inside the emulator.

Deani Hansen
  • 722
  • 4
  • 13
  • 1
    Hi, Thank you for your response. However, with this answer the culture/language won't be changed at design-time. You only see the result at run-time. – Tim Apr 05 '13 at 13:18