Google Answers Logo
View Question
 
Q: Using resources in Visual Studio .NET ( No Answer,   0 Comments )
Question  
Subject: Using resources in Visual Studio .NET
Category: Computers > Programming
Asked by: dinocrates-ga
List Price: $10.00
Posted: 26 Jun 2002 11:02 PDT
Expires: 26 Jul 2002 11:02 PDT
Question ID: 33625
Hi,

I need to use resources for internationalization in my .NET app, which
is being written in VB.NET.

Problem is I can't seem to load localized versions of files. For
example, I have these two files as "embedded resource":

units.xml
units.es.xml

Then, using a ResourceManager I load "MyNamespace.units.xml". Problem
is it always uses "units.xml" no matter the current OS culture or no
matter even if I override the culture info. Oh, and I can't load
"units.es.xml" if I try to load it directly, so that means the file IS
being embedded as a localized resource, but only Gates knows in what
language or how to load it...

So, what I need is a solution for this problem, or an example of
working code that does <B>exactly</B> what I want. I DON'T want code
that loads a file filename checking the culture info, as that must be
automatically done by the framework.

Regards,
Ivan V.

Request for Question Clarification by studboy-ga on 26 Jun 2002 18:29 PDT
Are you using Visual Studio?  WinRes?  If so convert with your 
files to have.resx extensions.  Otherwise use /resx when compiling
on the command line--please let me know if this is what you're
looking for and whether it works for you--I can turn this
into a formal answer but I need to know whether I'm on the 
right track--thanks:

http://www.devx.com/dotnet/articles/oc022102/oc022102-6.asp
http://msdn.microsoft.com/msdnmag/issues/02/06/internat/internat.asp

Clarification of Question by dinocrates-ga on 26 Jun 2002 19:36 PDT
I'm using Visual Studio. What do you mean by converting to resx? Just
changing the extension or do I need to do something more? The command
line "option is not an option" :)

Tomorrow I'll try changing the extensions, and I'll let you know if
that works so you claim the answer.

Thanks.

Request for Question Clarification by studboy-ga on 27 Jun 2002 01:23 PDT
Hi Ivan

I reread your question and I got a better idea of what you're trying
to do now--
I'm assuming when you say you're using the ResourceManager to load the
files,
the files themselves are already in resource format (ie, already
converted
to .resources) Maybe you can cut and paste the commands you used to
call up the ResourceManager and load the resource?

Thanks

Clarification of Question by dinocrates-ga on 01 Jul 2002 12:59 PDT
Sample code:

First the declarations:

Public gresMan As ResourceManager
Public gresStream As Stream = Nothing

Then the actual usage:

gresMan = New ResourceManager("HEMAC.iConvert.Resources",
System.Reflection.Assembly.GetExecutingAssembly)
gresStream = System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("HEMAC.iConvert.units.xml")

I don't get the desired result even if I do this first:

System.Threading.Thread.CurrentThread.CurrentUICulture = New
CultureInfo("es-MX")

I hope you can help me out!
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy