Solved

asp.net resource files, do I need to set a default language?

Posted on 2011-09-29
2
275 Views
Last Modified: 2012-06-27
I need to add resource files to my application.  In most instances there will be only one verions.  I initially used riblet.rexs, but then started seeing errors in the log file that said it was looking for riblet.en-Us.resx.  Do I need to name my file this?  I realize that this is english.

My thought was to use the file with no language extension, then add files with language extensions only when it was necessary, for instance if I needed to add a french version.

In most cases the files will be language neutral and will just hold values that need to be changed without recompiling the code.
0
Comment
Question by:jackjohnson44
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 36862251
A neutral resource is compiled into the code. So you need to recompile the application to change a value.

A language specific resource can be changed without recompiling the application itself, but you need to recompile the resource. Not a lot better.

If you want values that need to be changed without recompiling, you need to save them as settings. There is a good presentation of how to use settings in ASP at the following site: http://aspalliance.com/820
0
 

Author Comment

by:jackjohnson44
ID: 36903644
Thanks.  I know how to deploy.  Everythign works.
If I try to access a file like below, I will get lines in the log file that say it can't find Riblet.en-US.resx.  It will still find the value and everythign works, but the log files fill up.

SPUtility.GetLocalizedString("$Resources:key", "Riblet", (uint)System.Threading.Thread.CurrentThread.CurrentCulture.LCID);

I want to optionally use additional languages only if I need them.  So if I want Riblet.fr.resx I can use it, if not it will default to the Riblet.rexs file.  I can get around the error by using Riblet.en-US.resx, but I don't want to also use Riblet.resx which would be an exact copy.

Again, the function call works, I just don't want the log file filling up.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question