Link to home
Create AccountLog in
Avatar of jxbma
jxbmaFlag for United States of America

asked on

How do I store/retrieve strings from my resource file for localization in my .Net Winforms application?

Hi:

I'm building a .net winforms application.

I want to store my runtime strings into a resource file for localization.

I have a couple of questions:
-----------------------------------------
1) How do I store my strings into the resources?

2) How do I retrieve my resourced strings at runtime (for using in MessageBoxes, etc)?

3) What is the best overall strategy for string/resource localization and management?

4) Will 1) & 2)  be different for WPF applications/windows?

Thanks,
JohnB
Avatar of Naman Goel
Naman Goel
Flag of India image

Avatar of jxbma

ASKER

I get the basic premise for winforms. But, it still not totally clear.
I know I've got to deal with 1) Text in the controls (buttons, etc), 2) Text used in message strings. We need to be able to switch languages at startup, correct?

What do I do for resourced string files in winforms? I'll have all my strings in a resource file. That file will then be translated into other languages. How do I switch to the appropriate string resource file at runtime?

Can you point me to a small working example/sample so I can see this in action?

Thanks,
JB
ASKER CERTIFIED SOLUTION
Avatar of Naman Goel
Naman Goel
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer