Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make multilanguage C# console application?

I want to create console application in Microsoft Visual C# 2010 Express that will have support for a few languages: it will show messages in selected language. What is the simpliest and convenient way to make it international-ready?

like image 403
Simon Perepelitsa Avatar asked May 28 '10 07:05

Simon Perepelitsa


1 Answers

Your best bet is to use assembly resource files using the project menu then add resources to your file.

To use the language specific resources in your program:

System.Resources.ResourceManager mgr = new
    System.Resources.ResourceManager("MyConsoleApp.MyResource",
    System.Reflection.Assembly.GetExecutingAssembly()) ;

Console.WriteLine ( mgr.GetString ("resourceName"));

Console.ReadLine ();
like image 194
Laramie Avatar answered Oct 15 '22 17:10

Laramie