Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How to handle multiple idioms? - Resources
I need to use multiple idioms in my program using resources but I need some help..
I have a strings.txt (taken from an example..) with:
promptCulture = Please select the culture you wish to view this example in ==>
promptName = Please enter your name ==>
promptAge = Please enter your age ==>
promptDegrees = Please enter the current temperature,
promptMissing = Please ensure you enter a valid value.
promptValidAge = Please enter a valid age for an adult (15 and up)
promptDist = Please tell us how far you travel to work
promptValidDist = Please enter a valid distance (greater than zero).
promptValidDeg = Please enter a viable outside temperature (-100 to 140).
promptEntries = You entered the following information:
And the code:
private void Form1_Load(object sender, System.EventArgs e)
rmIdiom = new ResourceManager("strings", System.Reflection.Assembly.GetExecutingAssembly());
ciInfoIdiom = new CultureInfo(CultureInfo.CurrentUICulture.Name);
MessageBox.Show(rmIdioma.GetString( "promptName", ciInfoIdioma ));
It's supposed I have to have one dir per idiom then with its dll.. but as I execute the above code I get an exception:
How do I add my "strings.resources" to the project? I've tryied the Dos compilation using /res:.. and it doesn't work. :((
I've read something about 'the neutral idiom', is this involved too?
Sorry I'm making so many questions. Big thankies in advance.
0 · ·