C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to handle multiple idioms? - Resources Posted by while1fork on 25 Jun 2004 at 4:31 AM
Hey,

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:

[strings]
;prompts
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(ciInfoIdioma.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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.