10

I have a WPF application for which I have extracted all the strings in the WPF controls into an .resx file. I also have .resx files for each language supported (.es.resx, .ja.resx, etc.).

Is there an easy/straightforward way to view what the output will look like in the other languages during design time. It would save quite a bit of time to not have to run the application, see which controls needed adjustment, make notes, stop the application, make the changes and repeat.

I would much rather make the changes directly during design time using Blend.

Any ideas?

6
  • You mean, you want to see a design-time view of your app in German or Japanese, for example? Commented Mar 11, 2011 at 20:50
  • Yes, exactly. I would like to somehow make the design time view for Expression Blend use the .resx files for another language so I can see the layout without having to run the application. Commented Mar 11, 2011 at 20:58
  • What if to change culture in the Control Panel? I've never tried, just suggest. Commented Mar 11, 2011 at 21:06
  • That works for testing while running but has no effect during design time viewing. Commented Mar 15, 2011 at 19:09
  • Interesting - do you have code that loads up the language specific .resx files at runtime, or is that just handled by the runtime? Also, are the english strings also in a .resx file? One hackish way might just be to rename one of the other languages to the same name as the english file... Commented Mar 17, 2011 at 13:12

2 Answers 2

1

Here are couple of links that will help you:

WPF Runtime Localization - Design-Time Solution for UserControls
WPF Globalization and Localization Overview

Sign up to request clarification or add additional context in comments.

1 Comment

I think if you need better localization support you should stay away from .resx files and use the approach taken in the above mentioned frameworks. This way you can have better control on the design surface (Blend and VS).
0

I went with what was suggested in one of the comments by RQDQ.

  1. Rename foo.resx to foo.copy.resx (using foo as a generic name placeholder)
  2. Make a copy of the language you wish to test and rename it to foo.resx : so, for example, copy foo.fr.resx to foo.fr.copy.resx and then rename to foo.resx to test out how the French translation will look during design time.
  3. Clean and Rebuild the entire Expression Blend solution.
  4. The strings that have been localized will now appear in the controls in the language you are testing; in this example French.

You will now be able to make changes during design time using the translated strings. Just make sure you reverse the process when you finish making your changes or your default language will end up being the language you are testing and making adjustments with.

I am not crazy about this solution but it works. I also hesitate to mark this as the answer as I answered my own question, but I believe it is the correct answer. Any suggestions on this?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.