Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Internationalization / December 2004

Tip: Looking for answers? Try searching our database.

Must resource files be compiled with the application?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve E. - 09 Dec 2004 23:36 GMT
Hello,

Do resource files need to be compiled into the application? If not, how can
I do this? If so, isn't that a bit of a limitation?

I'm thinking of a case where the translations may change somewhat
frequently - it would be easy to, say, swap out a text resource file, but
not so desirable to recompile the application.  Naturally, I'm considering
using a database instead of a resource file for this, but would like to have
a complete picture of my options.

Thanks for your help,

Steve E.
Stefan Frutiger - 10 Dec 2004 14:43 GMT
> Do resource files need to be compiled into the application? If not, how
> can
[quoted text clipped - 6 lines]
> have
> a complete picture of my options.

Hi Steve

You can modify or create new translations without recompilation of the main
application:

1. Compile the *.resx files with ResGen.exe into *.resources files

2. Create satellite assemblies (per language) with AL.exe

3. Put the assemblies in a subfolder (e.g. "en" for English, "de" for
German, ...)

Have a look at www.multilizer.com: The tool does a good job for the first
step.

Kindly, Stefan
Poonam - 14 Dec 2004 22:33 GMT
Hi,
I am also struggling with resource files. I created a web application and
added couple of resx files using .NET studio. As you suggested I compiles
these files and ran
Al.exe /t:lib /embed:labels.resources /culture:en
/out:Lab3-CS-Starter-1.resources.dll

like I mentioned above. But when I ran my application I got following error:

Could not find any resources appropriate for the specified culture (or the
neutral culture) in the given assembly. Make sure
"Lab3-CS-Starter-1.labels.resources" was correctly embedded or linked into
assembly "Lab3-CS-Starter-1". baseName: Lab3-CS-Starter-1.labels
locationInfo: <null> resource file name: Lab3-CS-Starter-1.labels.resources
assembly: Lab3-CS-Starter-1, Version=1.0.1809.21474, Culture=neutral,
PublicKeyToken=null

Could you please help?

Thanks

> > Do resource files need to be compiled into the application? If not, how
> > can
[quoted text clipped - 23 lines]
>
> Kindly, Stefan
Alfredo Delgadillo - 18 Dec 2004 14:23 GMT
Hi,

whe you get string or object from you satellite assembly send cultureinfo

Threading.Thread.CurrentThread.CurrentCulture = New
Globalization.CultureInfo("en")
           Threading.Thread.CurrentThread.CurrentUICulture = New
Globalization.CultureInfo("en-US")

           Dim ret As String = String.Empty

           Dim rm As Resources.ResourceManager = New
Resources.ResourceManager("Lab3-CS-Starter-1.labels",
System.Reflection.Assembly.GetExecutingAssembly()) 'MyAssembly)  
'System.Reflection.Assembly.GetExecutingAssembly())
           rm.IgnoreCase = True
           ret = rm.GetString(<Resource ID>,
Threading.Thread.CurrentThread.CurrentUICulture)
           
           rm = Nothing
           If ret Is Nothing Then ret = String.Empty
           MessageBox.Show(ret)

> Hi,
> I am also struggling with resource files. I created a web application and
[quoted text clipped - 44 lines]
> >
> > Kindly, Stefan
Michael (michka) Kaplan [MS] - 18 Dec 2004 19:43 GMT
"Alfredo Delgadillo" <AlfredoDelgadillo@discussions.microsoft.com> wrote...

> Threading.Thread.CurrentThread.CurrentCulture = New
> Globalization.CultureInfo("en")

You should be very careful here -- CurrentCulture is used for formatting and
parsing, which will not work with neutral cultures like "en".

>             Threading.Thread.CurrentThread.CurrentUICulture = New
> Globalization.CultureInfo("en-US")

CurrentUICulture, on the other hand, *can* be neutral.

Signature

MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Microsoft Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.