I am developing a small project about using multiple language.
I have three resource files
- MainForm.resx // Default version => English
- MainForm.US.resx // English version
I define
- MainForm.JP.resx // Japanese version
I define
I want to get value of each variable (btnCancel, btnLogin, lbPassword, lbUsername, ...)
Now, I do
- From MainForm.US.resx, I build to MainForm.US.designer.cs (MainForm_US class)
- From MainForm.JP.resx, I build to MainForm.JP.designer.cs (MainForm_JP class)
- I make another class MainFormResource.cs. Here, I will check Thread.CurrentThread.CurrentUICulture.Name value
If is equal "ja-JP", I get value from MainForm.JS.designer.cs (MainForm_JP class)
If is equal "en-US", I get value from MainForm.US.designer.cs (MainForm_US class)
But if my project is large, it will take me more time to do that.
How should I do to get the value of lbUsername, lbPassword, ...?
p/s: I use Windows Form Application in Visual Studio Ultimate 2012