jxbma
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
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
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
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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
http://www.dotnetcurry.com/ShowArticle.aspx?ID=174
http://jebarson.info/post/2011/03/24/localization-multilingual-support-using-resource-files-in-net.aspx
you can't use resx file directly in wpf
please refer to following msdn article for wpf :
http://msdn.microsoft.com/en-us/library/ms788718.aspx